Пікірлер
@krishpoptani7862
@krishpoptani7862 2 сағат бұрын
Solution was easy to follow and articulated well! Thanks
@codeby_naruto
@codeby_naruto 11 минут бұрын
❤️❤️
@AryanPanchal-r1s
@AryanPanchal-r1s 4 сағат бұрын
Amazing explanation !!
@codeby_naruto
@codeby_naruto 11 минут бұрын
Thank you ❤️❤️
@AryanPanchal-r1s
@AryanPanchal-r1s 4 сағат бұрын
Very nice explanation
@codeby_naruto
@codeby_naruto 11 минут бұрын
Thank you ❤️❤️
@tanyasingh4023
@tanyasingh4023 11 сағат бұрын
Thank you for the explanation
@codeby_naruto
@codeby_naruto 9 сағат бұрын
❤️❤️
@shubhamjaiswal7645
@shubhamjaiswal7645 13 сағат бұрын
nice explanation
@codeby_naruto
@codeby_naruto 9 сағат бұрын
❤️❤️
@shubhamjaiswal7645
@shubhamjaiswal7645 Күн бұрын
very nice solution brother ...i have subscribed your channel
@codeby_naruto
@codeby_naruto 22 сағат бұрын
❤️❤️
@DeepakGupta-rp8ld
@DeepakGupta-rp8ld Күн бұрын
You can also upload gfg POTD
@codeby_naruto
@codeby_naruto Күн бұрын
Ya sure i will do ❤️
@DeepakGupta-rp8ld
@DeepakGupta-rp8ld Күн бұрын
Great today u provide source code in git hub ❤❤
@a3rdtierguy864
@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
@codeby_naruto Күн бұрын
Okay bro i will do.. ✨✌️
@a3rdtierguy864
@a3rdtierguy864 Күн бұрын
Unable to build up the approach today approach aa gya tha user defined sorting ka syntaax nhi pta tha so here
@DeepakGupta-rp8ld
@DeepakGupta-rp8ld Күн бұрын
Source code provide kro subscriber boom karenge ❤❤❤❤❤❤
@DeepakGupta-rp8ld
@DeepakGupta-rp8ld Күн бұрын
On your tithun
@DeepakGupta-rp8ld
@DeepakGupta-rp8ld Күн бұрын
Github
@codeby_naruto
@codeby_naruto Күн бұрын
I will do from next video ❤️❤️
@GB-su9gu
@GB-su9gu 2 күн бұрын
Make video of how to understand constraints ❤
@codeby_naruto
@codeby_naruto 2 күн бұрын
Okay i will do ✌️✨
@shubhamjaiswal7645
@shubhamjaiswal7645 2 күн бұрын
1 number
@codeby_naruto
@codeby_naruto 2 күн бұрын
❤️
@codeby_naruto
@codeby_naruto 2 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 3 күн бұрын
very nice explanation
@codeby_naruto
@codeby_naruto 3 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 3 күн бұрын
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; } };
@saisampath3872
@saisampath3872 4 күн бұрын
Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!
@codeby_naruto
@codeby_naruto 3 күн бұрын
Thank you ❤️❤️
@a3rdtierguy864
@a3rdtierguy864 4 күн бұрын
Bhaiya please provide us solution of contest question solution please
@codeby_naruto
@codeby_naruto 4 күн бұрын
Yaa sure ❤️
@yashpant8055
@yashpant8055 4 күн бұрын
You explain nice from others make more video on other important question
@codeby_naruto
@codeby_naruto 4 күн бұрын
Thank you ❤️❤️, I will do..
@harshitgoel4143
@harshitgoel4143 4 күн бұрын
@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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 4 күн бұрын
very nice explanation
@codeby_naruto
@codeby_naruto 4 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 4 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 5 күн бұрын
very good
@codeby_naruto
@codeby_naruto 5 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 5 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 6 күн бұрын
good solution
@codeby_naruto
@codeby_naruto 5 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 6 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 7 күн бұрын
very nice approach
@codeby_naruto
@codeby_naruto 6 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 7 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 8 күн бұрын
very good explanation
@codeby_naruto
@codeby_naruto 6 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 6 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 8 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 9 күн бұрын
awesome explanation
@codeby_naruto
@codeby_naruto 9 күн бұрын
Thank you ❤️❤️
@shubhamjaiswal7645
@shubhamjaiswal7645 9 күн бұрын
@saone.777
@saone.777 9 күн бұрын
Good explaination bro
@codeby_naruto
@codeby_naruto 9 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 9 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 10 күн бұрын
@shubhamjaiswal7645
@shubhamjaiswal7645 10 күн бұрын
@shubhamjaiswal7645
@shubhamjaiswal7645 10 күн бұрын
@shubhamjaiswal7645
@shubhamjaiswal7645 10 күн бұрын
good one
@codeby_naruto
@codeby_naruto 10 күн бұрын
Thank you ❤️❤️
@shubhamjaiswal7645
@shubhamjaiswal7645 10 күн бұрын
nice explanation
@codeby_naruto
@codeby_naruto 10 күн бұрын
Thank you ❤️❤️
@codeby_naruto
@codeby_naruto 10 күн бұрын
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; } };
@shubhamjaiswal7645
@shubhamjaiswal7645 11 күн бұрын
@shubhamjaiswal7645
@shubhamjaiswal7645 11 күн бұрын
@shubhamjaiswal7645
@shubhamjaiswal7645 11 күн бұрын
very nice
@codeby_naruto
@codeby_naruto 11 күн бұрын
❤️❤️
@codeby_naruto
@codeby_naruto 11 күн бұрын
Code :- class Solution { public: vector<ListNode*> splitListToParts(ListNode* head, int k) { vector<ListNode*> result(k, nullptr); int listLen = 0; for (ListNode* node = head; node; node = node->next) listLen++; int baseSize = listLen / k, extraNodes = listLen % k; ListNode *node = head, *lastNode = nullptr; for (int i = 0; node && i < k; i++, extraNodes--) { result[i] = node; for (int j = 0; j < baseSize + (extraNodes > 0); j++) { lastNode = node; node = node->next; } lastNode->next = nullptr; } return result; } };
@gruprttt
@gruprttt 12 күн бұрын
👏 💯
@codeby_naruto
@codeby_naruto 11 күн бұрын
❤️❤️
@codeby_naruto
@codeby_naruto 12 күн бұрын
Code: class Solution { public: bool findSubPath(ListNode* head, TreeNode* root) { if (!head) return true; if (!root) return false; return head->val == root->val && (findSubPath(head->next, root->left) || findSubPath(head->next, root->right)); } bool isSubPath(ListNode* head, TreeNode* root) { if (!root) return false; return findSubPath(head, root) || isSubPath(head, root->left) || isSubPath(head, root->right); } };
@codeby_naruto
@codeby_naruto 13 күн бұрын
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 } };
@roshanCodeCortex
@roshanCodeCortex 13 күн бұрын
which app are you using for making notes?
@codeby_naruto
@codeby_naruto 13 күн бұрын
Goodnotes
@riteshVeerAhir
@riteshVeerAhir 14 күн бұрын
Thank you sir
@codeby_naruto
@codeby_naruto 14 күн бұрын
Welcome ❤️❤️
@codeby_naruto
@codeby_naruto 14 күн бұрын
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; } };