Thank you for the clear explanation! It was very easy to understand the way you explained it.
@myko_chxnАй бұрын
Love you channel for the more niche problems. Thank you so much
@rahil645511 күн бұрын
Great explanation thank you so much. I guess you could remove the set all together and just search through the string builder, but that would only be if you value memory more than runtime.
@aliglens8 ай бұрын
great video! the space complexity is O(n) though, because its bounded by the string builder array which will have n elements in it.
@manne47957 ай бұрын
The seen set will ensure that no duplicate elements are added to the string builder array. And there are only 26 possible elements as the input string consists of only lowercase English letters. So the space complexity is O(26)=O(1)