#### Example

Given “bbb”, the answer is 1.

Given “pwwke”, the answer is 3.

#### Algorithm

Time complexity: O(n)

- Have a pointer which tracks the starting index of the current substring

- Create a map of each character and its index
- If the current character is in the lookup
- Change the starting index

- If the current character is in the lookup

- Add the current character to the map

- Update the max length of the substring

```
```

Solution