- 228
- 36 044
Pulkit Malhotra
India
Приєднався 12 чер 2016
Welcome to about section of my channel. Tune in here to watch video about my work and be a member of our family.
I'm lucky that my work help a wide range of brilliant and insightful people. Check out my latest video in the channel and i hope you will like it. Feel Free to share them with your family, friends and stay in touch.
For Business quarries :
pulkit161001@gmail.com
I'm lucky that my work help a wide range of brilliant and insightful people. Check out my latest video in the channel and i hope you will like it. Feel Free to share them with your family, friends and stay in touch.
For Business quarries :
pulkit161001@gmail.com
POTD- 18/10/2024 | Single Number | Problem of the Day | GeeksforGeeks
POTD: www.geeksforgeeks.org/problems/single-number1014/1
Code: discuss.geeksforgeeks.org/comment/ccef1be7-8ea9-47ab-accd-746559ff2889/practice
Timestamp:
00:00 - Explanation
00:26 - Approach
01:23 - Code
Connect with me :
LinkedIn: www.linkedin.com/in/thepulkitmalhotra/
Twitter: mobile. PulkitMalhotraa
GitHub: github.com/PulkitMalhotra161001
#coding #programming #GeeksforGeeks #ProblemofTheDay #CodingQuestions #POTD #problemsolving #practice #dsa #gfgpotd #gfg #dailychallenge #cpp #java #datastructures #algorithms #PulkitMalhotra #microsoft #amazon #google #flipkart #facebook #adobe #faang #interviewquestions
Code: discuss.geeksforgeeks.org/comment/ccef1be7-8ea9-47ab-accd-746559ff2889/practice
Timestamp:
00:00 - Explanation
00:26 - Approach
01:23 - Code
Connect with me :
LinkedIn: www.linkedin.com/in/thepulkitmalhotra/
Twitter: mobile. PulkitMalhotraa
GitHub: github.com/PulkitMalhotra161001
#coding #programming #GeeksforGeeks #ProblemofTheDay #CodingQuestions #POTD #problemsolving #practice #dsa #gfgpotd #gfg #dailychallenge #cpp #java #datastructures #algorithms #PulkitMalhotra #microsoft #amazon #google #flipkart #facebook #adobe #faang #interviewquestions
Переглядів: 12
Відео
POTD- 17/10/2024 | Split Linked List Alternatingly | Problem of the Day | GeeksforGeeks
Переглядів 902 години тому
POTD: www.geeksforgeeks.org/problems/split-singly-linked-list-alternatingly/1 Code: discuss.geeksforgeeks.org/comment/b88da08b-97c2-43fe-959c-2ab0f9af57ec/practice Timestamp: 00:00 - Explanation 01:22 - Approach 04:35 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming ...
POTD- 16/10/2024 | Two Swaps | Problem of the Day | GeeksforGeeks
Переглядів 1994 години тому
POTD: www.geeksforgeeks.org/problems/two-swaps 155623/1 Code: discuss.geeksforgeeks.org/comment/be9e380f-da3c-454f-8071-a23b28c505f5/practice Timestamp: 00:00 - Explanation 01:25 - Approach 14:08 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #Proble...
POTD- 15/10/2024 | Subarray range with given sum | Problem of the Day | GeeksforGeeks
Переглядів 1827 годин тому
POTD: www.geeksforgeeks.org/problems/subarray-range-with-given-sum0128/1 Code: discuss.geeksforgeeks.org/comment/a9aa2675-e5a2-4565-ab88-7ee9fca342bf/practice Timestamp: 00:00 - Explanation 01:09 - Approach 10:55 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #Geek...
POTD- 14/10/2024 | Count Linked List Nodes | Problem of the Day | GeeksforGeeks
Переглядів 529 годин тому
POTD: www.geeksforgeeks.org/problems/count-nodes-of-linked-list/1 Code: discuss.geeksforgeeks.org/comment/c7f87a30-67c9-4e20-8dc3-7e1554c32116/practice Timestamp: 00:00 - Explanation 00:42 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #ProblemofTheD...
POTD- 13/10/2024 | Delete Alternate Nodes | Problem of the Day | GeeksforGeeks
Переглядів 7112 годин тому
POTD: www.geeksforgeeks.org/problems/delete-alternate-nodes/1 Code: discuss.geeksforgeeks.org/comment/96783a72-16db-4271-94af-0306e8990396/practice Timestamp: 00:00 - Explanation 01:02 - Approach 04:13 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #...
POTD- 12/10/2024 | Two Smallests in Every Subarray | Problem of the Day | GeeksforGeeks
Переглядів 28714 годин тому
POTD: www.geeksforgeeks.org/problems/maximum-sum-of-smallest-and-second-smallest-in-an-array/1 Code: discuss.geeksforgeeks.org/comment/7b207dc3-c59f-41a2-8c28-4edd489c7246/practice Timestamp: 00:00 - Explanation 02:55 - Approach 08:44 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #cod...
POTD- 11/10/2024 | Reorganize The Array | Cycle Sort | Problem of the Day | GeeksforGeeks
Переглядів 17416 годин тому
POTD: www.geeksforgeeks.org/problems/reorganize-the-array4810/1 Code: discuss.geeksforgeeks.org/comment/263661f7-4c10-461f-8862-f88dc55da14c/practice Timestamp: 00:00 - Explanation 01:17 - Approach 06:47 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks...
POTD- 10/10/2024 | Max distance between same elements | Problem of the Day | GeeksforGeeks
Переглядів 18819 годин тому
POTD: www.geeksforgeeks.org/problems/max-distance-between-same-elements/1 Code: discuss.geeksforgeeks.org/comment/8a9db2b3-e18c-4bb7-9f1d-87d2551a050d/practice Timestamp: 00:00 - Explanation 01:08 - Approach 02:53 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #Gee...
POTD- 09/10/2024 | Linked List Matrix | Problem of the Day | GeeksforGeeks
Переглядів 9921 годину тому
POTD: www.geeksforgeeks.org/problems/linked-list-matrix/1 Code: discuss.geeksforgeeks.org/comment/78096b65-3640-4140-bec0-ef43fb296984/practice Timestamp: 00:00 - Explanation 01:08 - Approach 13:46 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #Prob...
POTD- 08/10/2024 | Largest Pair Sum | Problem of the Day | GeeksforGeeks
Переглядів 66День тому
POTD: www.geeksforgeeks.org/problems/pair-sum 120604/1 Code: discuss.geeksforgeeks.org/comment/d60d0a4f-d082-42cf-b5b3-2a8b211ed4b5/practice Timestamp: 00:00 - Explanation 00:44 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #ProblemofTheDay #CodingQ...
POTD- 07/10/2024 | XOR Linked List | C++ | Problem of the Day | GeeksforGeeks
Переглядів 98День тому
POTD: www.geeksforgeeks.org/problems/xor-linked-list/1 Code: discuss.geeksforgeeks.org/comment/b7c0a53b-21d2-4952-87d9-eb4d090522ef/practice Timestamp: 00:00 - Clarification 00:38 - Explanation 02:43 - Explanation of insert() 09:23 - Explanation of getList() 13:48 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github...
POTD- 07/10/2024 | XOR Linked List | Java | Problem of the Day | GeeksforGeeks
Переглядів 374День тому
POTD: www.geeksforgeeks.org/problems/xor-linked-list/1 Code: discuss.geeksforgeeks.org/comment/88a7ed50-cbc6-4656-915c-64f7dfe5bdb3/practice Timestamp: 00:00 - Explanation 01:03 - Approach 02:13 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGeeks #Problem...
POTD- 06/10/2024 | Find the number of islands | Problem of the Day | GeeksforGeeks
Переглядів 289День тому
POTD: www.geeksforgeeks.org/problems/find-the-number-of-islands/1 Code: discuss.geeksforgeeks.org/comment/af55cb38-e5de-4960-b6df-06d5e41d0541/practice Timestamp: 00:00 - Explanation 01:05 - Approach 06:09 - Code 08:44 - Time and Space complexity Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001...
POTD- 05/10/2024 | Not a subset sum | Problem of the Day | GeeksforGeeks
Переглядів 102День тому
POTD: www.geeksforgeeks.org/problems/smallest-number-subset1220/1 Code: discuss.geeksforgeeks.org/comment/8b3f8ddb-f855-4206-92d9-92844f75f7e0/practice Timestamp: 00:00 - Explanation 00:40 - Approach 07:54 - Code Connect with me : LinkedIn: www.linkedin.com/in/thepulkitmalhotra/ Twitter: mobile. PulkitMalhotraa GitHub: github.com/PulkitMalhotra161001 #coding #programming #GeeksforGee...
POTD- 04/10/2024 | Deletion and Reverse in Circular Linked List | Problem of the Day | GeeksforGeeks
Переглядів 45814 днів тому
POTD- 04/10/2024 | Deletion and Reverse in Circular Linked List | Problem of the Day | GeeksforGeeks
POTD- 03/10/2024 | Majority Vote | Problem of the Day | GeeksforGeeks
Переглядів 50114 днів тому
POTD- 03/10/2024 | Majority Vote | Problem of the Day | GeeksforGeeks
Rotate and delete (updated) | POTD- 02/10/2024 | Problem of the Day | GeeksforGeeks
Переглядів 3514 днів тому
Rotate and delete (updated) | POTD- 02/10/2024 | Problem of the Day | GeeksforGeeks
POTD- 02/10/2024 | Rotate and delete | Problem of the Day | GeeksforGeeks
Переглядів 1,1 тис.14 днів тому
POTD- 02/10/2024 | Rotate and delete | Problem of the Day | GeeksforGeeks
POTD- 01/10/2024 | Multiply two linked lists | Problem of the Day | GeeksforGeeks
Переглядів 12414 днів тому
POTD- 01/10/2024 | Multiply two linked lists | Problem of the Day | GeeksforGeeks
POTD- 30/09/2024 | Merge two BST 's | Problem of the Day | GeeksforGeeks
Переглядів 19114 днів тому
POTD- 30/09/2024 | Merge two BST 's | Problem of the Day | GeeksforGeeks
POTD- 29/09/2024 | Total count | Problem of the Day | GeeksforGeeks
Переглядів 2914 днів тому
POTD- 29/09/2024 | Total count | Problem of the Day | GeeksforGeeks
POTD- 28/09/2024 | Minimal Cost | Problem of the Day | GeeksforGeeks
Переглядів 5414 днів тому
POTD- 28/09/2024 | Minimal Cost | Problem of the Day | GeeksforGeeks
POTD- 27/09/2024 | K Sized Subarray Maximum | Problem of the Day | GeeksforGeeks
Переглядів 55921 день тому
POTD- 27/09/2024 | K Sized Subarray Maximum | Problem of the Day | GeeksforGeeks
POTD- 26/09/2024 | Roof Top | Problem of the Day | GeeksforGeeks
Переглядів 10221 день тому
POTD- 26/09/2024 | Roof Top | Problem of the Day | GeeksforGeeks
POTD- 25/09/2024 | Palindrome Linked List | Problem of the Day | GeeksforGeeks
Переглядів 6221 день тому
POTD- 25/09/2024 | Palindrome Linked List | Problem of the Day | GeeksforGeeks
POTD- 24/09/2024 | Smallest window in a string | Problem of the Day | GeeksforGeeks
Переглядів 17321 день тому
POTD- 24/09/2024 | Smallest window in a string | Problem of the Day | GeeksforGeeks
POTD- 23/09/2024 | Missing And Repeating | Problem of the Day | GeeksforGeeks
Переглядів 9221 день тому
POTD- 23/09/2024 | Missing And Repeating | Problem of the Day | GeeksforGeeks
POTD- 22/09/2024 | Longest Prefix Suffix | KMP Algo. | Problem of the Day | GeeksforGeeks
Переглядів 38821 день тому
POTD- 22/09/2024 | Longest Prefix Suffix | KMP Algo. | Problem of the Day | GeeksforGeeks
POTD- 21/09/2024 | Clone a LL with next and random pointer | Problem of the Day | GeeksforGeeks
Переглядів 16221 день тому
POTD- 21/09/2024 | Clone a LL with next and random pointer | Problem of the Day | GeeksforGeeks
i would suggest to type the code instead, like u did yesterday, it may take more time, but it's better...
I had less time yesterday so I did the coding while making the video.
can you solve this question without using hashmap
We can use array but that will be costlier in terms of space complexity.
bro don't make such wasteless videos if you don't completely understand what really the problem is also gfg is fu** up with this problem
I requested to explain quetion fully. I don't know where i missed I didn't understand the question also
okay
Did you even understand the P.S. ? Please don't do this for views by copying the code from comments and explaining it.
There's a high chances that you are not a Java programmer. In the driver code XOR function is not written.
Check out this video (C++ language) : ua-cam.com/video/JCDxVovAIRo/v-deo.html
Keep it up brother
Hangup (SIGHUP) Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 41 out of bounds for length 41 at GFG.main(GFG.java:18) I am getting this, can you please check yours, I have reported this issue, even with your code this is coming for a very big test case
that error is now fixed and only shown when using as custom input, data is too huge more than 50, 000 chars that's why my code gets this, even though it's same as yours, except variables names.... even chatgpt didn't find any issues and not much difference in our code.. Hangup (SIGHUP) Exception in thread "main" java.lang.StackOverflowError at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solution.dfs(GFG.java:47) at Solutio
Hi u were stammering a lot can u pls speak in hindi
Hi, i am improving.
great explanation bhaiya
Kal se kuch n kuch problem aari hai geeksforgeeks mai code bhe sahi hota hai, fir bhe problm aari hai..
Ha bilkul, sahi kaha
what if there are more than two elements of frequency more than n/3 ?
it can not be possible.
The freq. have to be greater than n/3 >n/3 There's only two values possible Let's Take the min. freq a freq = (n/3)+1 b freq = (n/3)+1 n - (a freq) - (b freq) n - (n/3 + 1) - (n/3 + 1) n - 2n/3 - 2 (3n - 2n - 6)/3 (n-6)/3 n/3 - 2 Means third candidate freq is not greater than n/3
they changed the question now, TC etc and my marks are reduced now as well, 0 marks as it's saying I viewed the solution before successful submit jabki kal sab sahi se submit ho gaya tha
yes, i just checked but the given code still works
@@PulkitMalhotrayeah my code doesn't work now it was working earlier
thanks man, you cleared my doubt
yeah mera bhi same issue tha, weird question hai, and output expected output sab sahi tha,
GFG having a lot of mistakes these days.
nice explanation sir ji
Thank you so much brother
nice
Thank you!
Yr english ni boli jati to ku ghaseetni h
Hi, I am improving
awesome explanation!
poor explanation skills. Approach is good but explanation is worst!
Hi, I am improving
sir the solution code is not opening.can u please add another link.
try now
sir pls use java language
Okay
Can't we do this ???: void sort012(vector<int>& arr) { sort(arr.begin(),arr.end()); }
this is naive approach. not the expected one
@@PulkitMalhotra 😐
the code in description is not opening . can u please recheck it.
discuss.geeksforgeeks.org/comment/b12b4cc9-6215-4d88-8213-e1e6c7d81e01/practice
@@PulkitMalhotra Thanks a lot Sir for your efforts
my pleasure
Do you solve POTD everyday?
yes
very well explained brother!! Thanks!!
why this code is giving segmentation fault? class Solution { public: pair<int, bool> solve(vector<vector<pair<int, bool>>>& dp, vector<vector<int>>& grid, int i, int j) { if (i < 0 || j < 0 || i >= grid.size() || j >= grid[0].size()) return {INT_MAX, false}; if (dp[i][j].first != -1) return dp[i][j]; int res = INT_MAX; bool flag = false; auto p = solve(dp, grid, i + 1, j); if (p.second) { res = min(res, p.first); flag = true; } p = solve(dp, grid, i - 1, j); if (p.second) { res = min(res, p.first); flag = true; } p = solve(dp, grid, i, j - 1); if (p.second) { res = min(res, p.first); flag = true; } p = solve(dp, grid, i, j + 1); if (p.second) { res = min(res, p.first); flag = true; } if (!flag) { dp[i][j] = {INT_MAX, false}; } else { dp[i][j] = {grid[i][j] + res, true}; } return dp[i][j]; } int minimumCostPath(vector<vector<int>>& grid) { int n = grid.size(); int m = grid[0].size(); vector<vector<pair<int, bool>>> dp(n, vector<pair<int, bool>>(m, {-1, false})); dp[0][0] = {grid[0][0], true}; auto p = solve(dp, grid, n - 1, m - 1); return p.second ? p.first : -1; } };
Sir please java me baniye pl😢ease please please please please please please please please please please please please
Okay
why not dp my code not working on case 1114 class Solution { //Function to return the minimum cost to react at bottom //right cell from top left cell. public int minimumCostPath(int[][] grid) { // Code here int row = grid.length; int col = grid[0].length; for(int j =1;j<col;j++) grid[0][j] = grid[0][j]+grid[0][j-1]; for(int i =1;i<row;i++) grid[i][0] = grid[i][0]+grid[i-1][0]; for(int i=1;i<row;i++){ for(int j =1;j<col;j++){ grid[i][j] = grid[i][j] + Math.min(grid[i][j-1],grid[i-1][j]); } } return grid[row-1][col-1]; } }
you are only considering top and left direction to find min.
you have to go down right left top
Thank you. I coded myself after understanding your approach.
class Solution{ void convertToString(vector<vector<char>> &a,vector<vector<int>> &ans,int n){ //storing col vector<int> temp; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(a[i][j]=='Q') temp.push_back(j+1); } } ans.push_back(temp); } bool isSafe(int row,int col,int n,vector<vector<char>> &a){ //same col for(int i=0;i<row;i++){ if(a[i][col]=='Q') return false; } //top left for(int i=row-1, j=col-1;i>=0 && j>=0;i--, j--){ if(a[i][j]=='Q') return false; } //top right for(int i=row-1, j=col+1;i>=0 && j<n;i--, j++){ if(a[i][j]=='Q') return false; } return true; } void solve(int i,int n,vector<vector<char>> &a,vector<vector<int>> &ans){ if(i==n){ convertToString(a,ans,n); return; } for(int j=0;j<n;j++){ if(isSafe(i,j,n,a)){ a[i][j]='Q'; solve(i+1,n,a,ans); a[i][j]='.'; } } } public: vector<vector<int>> nQueen(int n) { vector<vector<char>> a(n, vector<char>(n,'.')); vector<vector<int>> ans; solve(0,n,a,ans); return ans; } }; thank you !
The code in Java is also same
just a little syntax modification
Batsman can also take 5 runs by running between the wicket on last ball?
tbh knowledge or Approach was Good but explanation or Intuition is not good keep it up👍
Ok. Thanks
Amazing approach bro .. Keep it up , thanks for explanation
solution ka link provide kar diya Kro
Nice
thankyou so much sir
Keep Hard working bro your time will also come
Bhaiya continue ur videos in English only.. Thank you
Sure 👍
Nice
just apply the patter binary search on answers , this is exactly pased on same pattern check my code but it needss few modifications ,plzz correct me class Solution { public: bool check (int mid,int n,int k){ string h = to_string(mid); if(h.size()>n || h.size()<n){ return false; } if(h.size()==n){ if(mid%k>=0){ string r =h; reverse (r.begin(),r.end()); return h==r; } } return false; } string largestPalindrome(int n, int k) { int i=1; int j = 1000000; int ans =-1; while(i<=j){ int mid = (i+j)/2; if(check(mid,n,k)){ ans = j; i= mid+1; } else{ j=mid-1; } } string ok = to_string(ans); return ok; } };
good explanation
bhai bahut hi ganda samjha raha hai... time waste mat kar... mera b 5min waste karwa diye tune...
itna bhi ganda nhi tha bhai abhi start hi kar rha hai video banana @PulkitMalhotra bhai tum english - hindi mix kar ke bolo or eventually english mai shift kardo english - hindi mix se confidence badhalo apna video banane ka
@@focusman8801 Bhai... Ye solution galat b hai... This only works because tests are garbage. Imagine a 500x500 matrix where one row is all 10**9 and the rest are random numbers. His code will fail to find a combination that is not from the same row. I someone is looking for a video to improve his knowledge, He doesn't deserve to see a wrong solution... Also, Is bande ne contest khatam hone ke baad real solution b nahi dekha... which means ye banda khud b improve nahi karega.. and baki log ko b galat gyan dega... Sorry pulkit bhai... But please take it as a point to improve....
Why do we need to do b[0] - a[0] becuase priority queue naturally stores the data in max heap format.
for single data types only. we are having an array as pq elements. so we need to provide the comparator.
Why only top 15 values work fine?
yes i also have this doubt please explain why 15 ?
This is not working for below test case: [[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]
Test cases are week
For that we need to find top 25 elements. But for bigger testcase this will also fail. I got your point. For 500x500 if testcase are good we need 3x500 top elements.
In boolean function, how you are returning integer value to a boolean function? plz copy carefully before uploading the video
I suppose you are pointing to 7:58. Here we are checking req<=k. What it mean is if required value is less than or equal to k it will return true otherwise false. It is checking a condition and returning boolean not int.
🤔 hmmm
Love from Deepanshu bro🫶🏻