Sergey Piterman
1 min readMar 10, 2020

--

Hey! Thanks for pointing that out. I went back to take a look at the code, and it looks like I used the version that doesn’t account for duplicate letters. It’s a slight modification, but basically instead of checking for at least one occurrence of a letter, you check for how many occurrences of that letter you need. So if you were searching for the substring “AAABCC”, you would make sure you had at least 3 copies of A, 1 of B and 2 of C.

I’ll add the code for this solution now :)

--

--

Sergey Piterman
Sergey Piterman

Written by Sergey Piterman

Technical Solutions Consultant @Google. Software Engineer @Outco. Content Creator. Youtube @ bit.ly/sergey-youtube. IG: @sergey.piterman. Linkedin: @spiterman

Responses (1)