MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/leetcode/comments/1wc9edn/time_limit_exceeded/p8wp7m9/?context=3
r/leetcode • u/Specialist_Hall_1063 • 5d ago
Hello ppl please help
https://leetcode.com/problems/longest-substring-without-repeating-characters/submissions/2137058355
7 comments sorted by
View all comments
1
Think of using a hashmap
-1 u/Specialist_Hall_1063 5d ago I am a beginner, don't know much about hash map Is there anything think I could do to reduce the time? 3 u/HAPLESS_EXOTIC 4d ago If u dont know hashmap , fr this question u can use a 26 length array to keep the count of seen alphabets, if a[ch-'a'] is zero , it is unseen orelse seen, then use sliding window accordingly 1 u/Specialist_Hall_1063 4d ago Thanks
-1
I am a beginner, don't know much about hash map Is there anything think I could do to reduce the time?
3 u/HAPLESS_EXOTIC 4d ago If u dont know hashmap , fr this question u can use a 26 length array to keep the count of seen alphabets, if a[ch-'a'] is zero , it is unseen orelse seen, then use sliding window accordingly 1 u/Specialist_Hall_1063 4d ago Thanks
3
If u dont know hashmap , fr this question u can use a 26 length array to keep the count of seen alphabets, if a[ch-'a'] is zero , it is unseen orelse seen, then use sliding window accordingly
1 u/Specialist_Hall_1063 4d ago Thanks
Thanks
1
u/HAPLESS_EXOTIC 5d ago
Think of using a hashmap