Leaqio.com
Aditya Verma from patreon
Aditya Verma patreon

Longest Substring With Without Repeating Characters

🕑 Added 2020-12-27 23:36:28 +0000 UTC

Comments

Tanushree Bhattacharji

Code is incorrect for this. ``` else if(mp.size()>k) { while(mp.size()>k) { mp[s[i]]--; if(mp[s[i]]==0) { mp.erase(s[i]); } i++; } j++; } ``` It should be mp.size() < j-i+1. No of distinct characters should be less than window size.

Vijaya Srivastava

can somebody send me the java code for this?


More Creators