Solution was easy to follow and articulated well! Thanks
@codeby_naruto11 минут бұрын
❤️❤️
@AryanPanchal-r1s4 сағат бұрын
Amazing explanation !!
@codeby_naruto11 минут бұрын
Thank you ❤️❤️
@AryanPanchal-r1s4 сағат бұрын
Very nice explanation
@codeby_naruto11 минут бұрын
Thank you ❤️❤️
@tanyasingh402311 сағат бұрын
Thank you for the explanation
@codeby_naruto9 сағат бұрын
❤️❤️
@shubhamjaiswal764513 сағат бұрын
nice explanation
@codeby_naruto9 сағат бұрын
❤️❤️
@shubhamjaiswal7645Күн бұрын
very nice solution brother ...i have subscribed your channel
@codeby_naruto22 сағат бұрын
❤️❤️
@DeepakGupta-rp8ldКүн бұрын
You can also upload gfg POTD
@codeby_narutoКүн бұрын
Ya sure i will do ❤️
@DeepakGupta-rp8ldКүн бұрын
Great today u provide source code in git hub ❤❤
@a3rdtierguy864Күн бұрын
bhaiya custom sort ka utna syntax dekar fill nhi aa rha ye to kuch true false karke work karta hai jaise hm ordering defined comparator in priority queue bhaiya ek video please banao comparator, string important function like istringstream and different function and custom sort aur acche se samjhane ke liye please
@codeby_narutoКүн бұрын
Okay bro i will do.. ✨✌️
@a3rdtierguy864Күн бұрын
Unable to build up the approach today approach aa gya tha user defined sorting ka syntaax nhi pta tha so here
@DeepakGupta-rp8ldКүн бұрын
Source code provide kro subscriber boom karenge ❤❤❤❤❤❤
@DeepakGupta-rp8ldКүн бұрын
On your tithun
@DeepakGupta-rp8ldКүн бұрын
Github
@codeby_narutoКүн бұрын
I will do from next video ❤️❤️
@GB-su9gu2 күн бұрын
Make video of how to understand constraints ❤
@codeby_naruto2 күн бұрын
Okay i will do ✌️✨
@shubhamjaiswal76452 күн бұрын
1 number
@codeby_naruto2 күн бұрын
❤️
@codeby_naruto2 күн бұрын
Code :- class Solution { public: vector<string> uncommonFromSentences(string A, string B) { unordered_map<string, int> count; istringstream iss(A + " " + B); while (iss >> A) count[A]++; vector<string> res; for (auto w : count) if (w.second == 1) res.push_back(w.first); return res; } };
@shubhamjaiswal76453 күн бұрын
very nice explanation
@codeby_naruto3 күн бұрын
Thank you ❤️❤️
@codeby_naruto3 күн бұрын
Code :- class Solution { public: int findMinDifference(vector<string>& T) { vector<int> ans; for (auto time : T) { string hour = time.substr(0, 2), minute = time.substr(3); int TotalMin = stoi(hour) * 60 + stoi(minute); ans.push_back(TotalMin); } sort(ans.begin(), ans.end()); // Adding the difference between the first and last times accounting for // wrap-around ans.push_back(ans[0] + 24 * 60); int minDiff = INT_MAX; for (int i = 1; i < ans.size(); ++i) { minDiff = min(minDiff, ans[i] - ans[i - 1]); } return minDiff; } };
@saisampath38724 күн бұрын
Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!
@codeby_naruto3 күн бұрын
Thank you ❤️❤️
@a3rdtierguy8644 күн бұрын
Bhaiya please provide us solution of contest question solution please
@codeby_naruto4 күн бұрын
Yaa sure ❤️
@yashpant80554 күн бұрын
You explain nice from others make more video on other important question
@codeby_naruto4 күн бұрын
Thank you ❤️❤️, I will do..
@harshitgoel41434 күн бұрын
@codeby_naruto can you plz tell me what is wrong in my approach class Solution { public: int maxi=INT_MIN; void checkforeven(unordered_map<char,int>&mp,unordered_map<char,int>&mp1,int i){ int v=INT_MIN; for(auto it:mp){ if((it.second%2!=0)){ v=max(v,mp1[it.first]); } } if(v!=INT_MIN){ maxi=max(maxi,(i-v)); } else maxi=i+1; } int findTheLongestSubstring(string s) { unordered_map<char,int>mp,mp1; for(int i=s.size()-1;i>=0;i--){ if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){ mp[s[i]]=i; } } for(int i=0;i<s.size();i++){ if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){ mp1[s[i]]++; } checkforeven(mp1,mp,i); } return maxi; } };
@shubhamjaiswal76454 күн бұрын
very nice explanation
@codeby_naruto4 күн бұрын
Thank you ❤️❤️
@codeby_naruto4 күн бұрын
Code :- class Solution { public: int findTheLongestSubstring(string s) { unordered_map<char, int> hash = { {'a', 1}, {'e', 2}, {'i', 4}, {'o', 8}, {'u', 16}}; vector<int> 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; } };
@shubhamjaiswal76455 күн бұрын
very good
@codeby_naruto5 күн бұрын
Thank you ❤️❤️
@codeby_naruto5 күн бұрын
Code :- class Solution { public: int longestSubarray(vector<int>& nums) { int x = *max_element(nums.begin(), nums.end()); int ans = 0, len = 0; for (int num : nums) { if (num == x) ans = max(ans, ++len); else len = 0; } return ans; } };
@shubhamjaiswal76456 күн бұрын
good solution
@codeby_naruto5 күн бұрын
Thank you ❤️❤️
@codeby_naruto6 күн бұрын
Code :- class Solution { public: vector<int> xorQueries(vector<int>& A, vector<vector<int>>& queries) { vector<int> res; for (int i = 1; i < A.size(); ++i) A[i] ^= A[i - 1]; for (auto& q : queries) res.push_back(q[0] > 0 ? A[q[0] - 1] ^ A[q[1]] : A[q[1]]); return res; } };
@shubhamjaiswal76457 күн бұрын
very nice approach
@codeby_naruto6 күн бұрын
Thank you ❤️❤️
@codeby_naruto7 күн бұрын
Code :- class Solution { public: int countConsistentStrings(string allowed, vector<string>& words) { int res = words.size(); bool alpha[26] = {}; for (char c : allowed) alpha[c - 'a'] = true; for (string word : words) { for (char c : word) { if (!alpha[c - 'a']) { res--; break; } } } return res; } };
@shubhamjaiswal76458 күн бұрын
very good explanation
@codeby_naruto6 күн бұрын
Thank you ❤️❤️
@codeby_naruto6 күн бұрын
Thank you ❤️❤️
@codeby_naruto8 күн бұрын
Code :- class Solution { public: int minBitFlips(int start, int goal) { int X = (start ^ goal); int count = 0; while (X) { if (X % 2) count++; X /= 2; } return count; } };
@shubhamjaiswal76459 күн бұрын
awesome explanation
@codeby_naruto9 күн бұрын
Thank you ❤️❤️
@shubhamjaiswal76459 күн бұрын
@saone.7779 күн бұрын
Good explaination bro
@codeby_naruto9 күн бұрын
Thank you ❤️❤️
@codeby_naruto9 күн бұрын
Code :- class Solution { public: ListNode* insertGreatestCommonDivisors(ListNode* head) { if (!head || !head->next) return head; ListNode* curr = head; while (curr && curr->next) { int first = curr->val; int second = curr->next->val; int gcd = __gcd(first, second); ListNode* newNode = new ListNode(gcd); newNode->next = curr->next; curr->next = newNode; curr = curr->next->next; } return head; } };
@shubhamjaiswal764510 күн бұрын
@shubhamjaiswal764510 күн бұрын
@shubhamjaiswal764510 күн бұрын
@shubhamjaiswal764510 күн бұрын
good one
@codeby_naruto10 күн бұрын
Thank you ❤️❤️
@shubhamjaiswal764510 күн бұрын
nice explanation
@codeby_naruto10 күн бұрын
Thank you ❤️❤️
@codeby_naruto10 күн бұрын
Code :- class Solution { public: vector<vector<int>> spiralMatrix(int rows, int cols, ListNode* head) { vector<vector<int>> matrix(rows, vector<int>(cols, -1)); int L = 0, R = cols - 1, T = 0, B = rows - 1; while (L <= R && T <= B) { // Traverse from left to right across the top row for (int col = L; col <= R; ++col) { if (head) { matrix[T][col] = head->val; head = head->next; } } T++; // Traverse from top to bottom down the right column for (int row = T; row <= B; ++row) { if (head) { matrix[row][R] = head->val; head = head->next; } } R--; // Traverse from right to left across the bottom row for (int col = R; T <= B && col >= L; --col) { if (head) { matrix[B][col] = head->val; head = head->next; } } B--; // Traverse from bottom to top up the left column for (int row = B; L <= R && row >= T; --row) { if (head) { matrix[row][L] = head->val; head = head->next; } } L++; } return matrix; } };
Code :- class Solution { public: ListNode* modifiedList(vector<int>& nums, ListNode* head) { unordered_set<int> mp(nums.begin(), nums.end()); // Directly initialize the set with nums ListNode* dummy = new ListNode(0); // Dummy node to handle edge cases like head deletion ListNode* curr = dummy; curr->next = head; while (head) { if (mp.find(head->val) != mp.end()) { curr->next = head->next; // Skip the node containing the value to remove } else { curr = curr->next; // Move to the next node } head = head->next; // Continue traversing the list } return dummy->next; // Return the updated list starting after the dummy node } };
@roshanCodeCortex13 күн бұрын
which app are you using for making notes?
@codeby_naruto13 күн бұрын
Goodnotes
@riteshVeerAhir14 күн бұрын
Thank you sir
@codeby_naruto14 күн бұрын
Welcome ❤️❤️
@codeby_naruto14 күн бұрын
Code :- class Solution { public: vector<int> missingRolls(vector<int>& rolls, int mean, int n) { int m = rolls.size(); int sum = 0; for (int i : rolls) { sum += i; } // Calculate the total sum required for n rolls int totalSum = mean * (n + m) - sum; // Check if it's possible to divide totalSum among n rolls (valid range is [1, 6]) if (totalSum < n || totalSum > 6 * n) { return vector<int>(); } vector<int> ans(n, totalSum / n); // Fill with the base value int remainder = totalSum % n; // Remaining to distribute // Distribute the remainder over the first few elements for (int i = 0; i < remainder; ++i) { ans[i]++; } return ans; } };