ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Code :-class Solution { public: int findTheLongestSubstring(string s) { unordered_map hash = { {'a', 1}, {'e', 2}, {'i', 4}, {'o', 8}, {'u', 16}}; vector bitset(32, -1); int mask = 0, maxLen = 0; for (int i = 0; i < s.size(); i++) { mask = mask ^ hash[s[i]]; if (mask != 0 && bitset[mask] == -1) bitset[mask] = i; maxLen = max(maxLen, i - bitset[mask]); } return maxLen; }};
Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!
Thank you ❤️❤️
You explain nice from others make more video on other important question
Thank you ❤️❤️, I will do..
very nice explanation
Bhaiya please provide us solution of contest question solution please
Yaa sure ❤️
Code :-
class Solution {
public:
int findTheLongestSubstring(string s) {
unordered_map hash = {
{'a', 1}, {'e', 2}, {'i', 4}, {'o', 8}, {'u', 16}};
vector bitset(32, -1);
int mask = 0, maxLen = 0;
for (int i = 0; i < s.size(); i++) {
mask = mask ^ hash[s[i]];
if (mask != 0 && bitset[mask] == -1) bitset[mask] = i;
maxLen = max(maxLen, i - bitset[mask]);
}
return maxLen;
}
};
Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!
Thank you ❤️❤️
You explain nice from others make more video on other important question
Thank you ❤️❤️, I will do..
very nice explanation
Thank you ❤️❤️
Bhaiya please provide us solution of contest question solution please
Yaa sure ❤️