![Naresh Gupta](/img/default-banner.jpg)
- 405
- 1 464 742
Naresh Gupta
India
Registrace 1. 01. 2012
I am Naresh Gupta, an IIT Guwahati Alumnus and Sr. Software Engineer at Careem (Uber). My goal is to share my knowledge of programming by posting educational videos on Data Structure and Algorithm Problem Solving, that will allow everyone to learn and prepare for interviews.
Join the channel, Naresh Gupta Timeline:
Hit 100 Subs on May 31, 2020
Hit 1,000 Subs on Aug 27, 2020
Hit 2,500 Subs on Dec 24, 2020
Hit 5,000 Subs on Aug 14, 2021
.
.
.
Hit 100K Subs on ……Yeah right, keep dreamin’ Naresh.......
*** SUBSCRIBE NOW ***
czcams.com/users/NareshGupta
Global Village Fireworks Dubai
#short #globalvillage #global #dubai #crackers #fireworks
zhlédnutí: 1 374
Video
Expo City Dome Lights Dubai
zhlédnutí 58Před 8 měsíci
#shorts #dubap #expocity #expo #dome #light #trending
Beautiful Pokhara Valley View from Sarangkot Nepal Hill Homestay Room
zhlédnutí 117Před 8 měsíci
#shorts #pokhara #nepal #mountains #lake #view #amazing #trending
Palm Island and Marina Skyscraper View from Balcony | Dubai Life
zhlédnutí 76Před 8 měsíci
#shorts #palmisland #dubaimarina #skyscraper #tower #view #dubai #dubailife #coderindubai
Tashkent Magic City Water Show | Uzbekistan | Central Asia
zhlédnutí 170Před 11 měsíci
Tashkent Magic City Water Show | Uzbekistan | Central Asia Follow me on - Instagram - naresh_gupta_foodie LinkedIn - www.linkedin.com/in/nareshiitg/
Dubai Drone Show | Enter The Future | Happy New Year 2023 | Blue Waters Island | The Beach JBR Dubai
zhlédnutí 2,9KPřed rokem
Dubai Drone Show | Enter The Future | Happy New Year 2023 | Blue Waters Island | The Beach JBR Dubai Follow me on - LinkedIn - www.linkedin.com/in/nareshiitg/ Instagram - naresh_gupta_foodie Facebook - groups/cookcodetravel Quora - www.quora.com/q/cookcodetravel
Happy New Year Fireworks | Happy New Year 2023 Dubai | JBR The Beach | Blue Water Island
zhlédnutí 385Před rokem
Happy New Year Fireworks | Happy New Year 2023 Dubai | JBR The Beach | Blue Water Island Follow me on - LinkedIn - www.linkedin.com/in/nareshiitg/ Instagram - naresh_gupta_foodie Facebook - groups/cookcodetravel Quora - www.quora.com/q/cookcodetravel
Max Consecutive Ones | LeetCode 485 | Array
zhlédnutí 1KPřed 2 lety
Problem Link - leetcode.com/problems/max-consecutive-ones/ Subscribe for more educational videos on data structure, algorithms and coding interviews - czcams.com/users/NareshGupta Code Repository - github.com/naresh1406/youtube/tree/master/src/main/cp/leetcode/problems Popular Playlists: Top Interview Questions: czcams.com/play/PLamEquLLzOthxXOEXLApkGm99TMUDrCmc.html Dynamic Programming: czcams...
RLE Iterator | LeetCode 900 | List TreeMap | Google
zhlédnutí 1,6KPřed 2 lety
(00:00) Problem Explanation (03:15) Brute Force (06:00) TreeMap Approach (10:30) Best Approach Problem Link - leetcode.com/problems/rle-iterator/Subscribe for more educational videos on data structure, algorithms and coding interviews - czcams.com/users/NareshGupta Code Repository - github.com/naresh1406/youtube/tree/master/src/main/cp/leetcode/problemsPopular Playlists:Top Interview Questions:...
Largest Plus Sign | LeetCode 764 | Matrix | Uber
zhlédnutí 2,5KPřed 2 lety
Problem Link - leetcode.com/problems/largest-plus-sign/ Subscribe for more educational videos on data structure, algorithms and coding interviews - czcams.com/users/NareshGupta Code Repository - github.com/naresh1406/youtube/tree/master/src/main/cp/leetcode/problems Popular Playlists: Top Interview Questions: czcams.com/play/PLamEquLLzOthxXOEXLApkGm99TMUDrCmc.html Dynamic Programming: czcams.co...
Shifting Letters | LeetCode 848 | String | Facebook
zhlédnutí 2,3KPřed 2 lety
Shifting Letters | LeetCode 848 | String | Facebook
Reverse Linked List | LeetCode 206 | Recursive Iterative
zhlédnutí 776Před 2 lety
Reverse Linked List | LeetCode 206 | Recursive Iterative
Slowest Key | LeetCode 1649 | String | Amazon
zhlédnutí 522Před 2 lety
Slowest Key | LeetCode 1649 | String | Amazon
Permutations | LeetCode 46 | TopInterview | Google Facebook | Backtracking
zhlédnutí 2,6KPřed 2 lety
Permutations | LeetCode 46 | TopInterview | Google Facebook | Backtracking
Reverse Integer | LeetCode 7 | Top Interview | Facebook Google Apple Amazon
zhlédnutí 8KPřed 2 lety
Reverse Integer | LeetCode 7 | Top Interview | Facebook Google Apple Amazon
Range Addition II | Leetcode 598 | Array Matrix
zhlédnutí 1,8KPřed 2 lety
Range Addition II | Leetcode 598 | Array Matrix
String to Integer atoi | Top Interview | Facebook Microsoft
zhlédnutí 1,8KPřed 2 lety
String to Integer atoi | Top Interview | Facebook Microsoft
Valid Sudoku | Leetcode 36 | Matirx | HashSet | Top Interview
zhlédnutí 7KPřed 2 lety
Valid Sudoku | Leetcode 36 | Matirx | HashSet | Top Interview
Thank You 5K Special | iPad Pro M1 Chip and Pencil Fast Unboxing
zhlédnutí 525Před 2 lety
Thank You 5K Special | iPad Pro M1 Chip and Pencil Fast Unboxing
Ferrari 🚘 Maranello Production Process Detail, Ferrari World, Abu Dhabi, UAE 🇦🇪
zhlédnutí 514Před 2 lety
Ferrari 🚘 Maranello Production Process Detail, Ferrari World, Abu Dhabi, UAE 🇦🇪
Path Sum II | Leetcode 113 | Tree DFS Backtracking | Facebook
zhlédnutí 6KPřed 2 lety
Path Sum II | Leetcode 113 | Tree DFS Backtracking | Facebook
Subsets II | Leetcode 90 | Backtracking | Facebook Amazon Apple
zhlédnutí 2KPřed 2 lety
Subsets II | Leetcode 90 | Backtracking | Facebook Amazon Apple
Making A Large Island | Leetcode 827 | Matrix Graph DFS Hard | Facebook Apple
zhlédnutí 2,1KPřed 2 lety
Making A Large Island | Leetcode 827 | Matrix Graph DFS Hard | Facebook Apple
Max Area of Island | Leetcode 695 | Matrix Graph BFS DFS | Google Facebook Amazon
zhlédnutí 1,1KPřed 2 lety
Max Area of Island | Leetcode 695 | Matrix Graph BFS DFS | Google Facebook Amazon
Trapping Rain Water | Leetcode 42 | 3 Solutions | Google Facebook Amazon | Hard
zhlédnutí 734Před 2 lety
Trapping Rain Water | Leetcode 42 | 3 Solutions | Google Facebook Amazon | Hard
Map Sum Pairs | Leetcode 677 | HashMap and Trie Solution
zhlédnutí 630Před 2 lety
Map Sum Pairs | Leetcode 677 | HashMap and Trie Solution
01 Matrix | Leetcode 542 | DFS BFS DP | Google Uber Amazon
zhlédnutí 10KPřed 2 lety
01 Matrix | Leetcode 542 | DFS BFS DP | Google Uber Amazon
3Sum Closest | Leetcode 16 | Two Pointer | Google Facebook Amazon
zhlédnutí 3,8KPřed 2 lety
3Sum Closest | Leetcode 16 | Two Pointer | Google Facebook Amazon
Binary Tree Pruning | Leetcode 814 | Binary Tree | Google Amazon
zhlédnutí 602Před 2 lety
Binary Tree Pruning | Leetcode 814 | Binary Tree | Google Amazon
Partition Array into Disjoint Intervals | Leetcode 915 | Array | Microsoft
zhlédnutí 862Před 2 lety
Partition Array into Disjoint Intervals | Leetcode 915 | Array | Microsoft
very nice solution keep it going bro
Thanks
but what if we change 0 to11 and 1 to 12 and 6 to 9 then the minimum value we be 9 and maximum wiil as it is 15 then difference will create of 6 . 15-9=6
if the String is long then we have to use this code : - import java.math.BigInteger; class Solution { public int compareVersion(String version1, String version2) { String v1[] = version1.split("\\."); String v2 []= version2.split("\\."); for (int i=0; i < Math.max(v1.length, v2.length); i++) { BigInteger num1 = i < v1.length ? new BigInteger(v1[i]) : BigInteger.ZERO; BigInteger num2 = i < v2.length ? new BigInteger(v2[i]) : BigInteger.ZERO; int comp = num1.compareTo(num2); if(comp == 0) { continue; } return comp; } return 0; } }
Kadane's Algorithm it is, I no where see DP. Please don't mention DP in heading
naresh bhai !!
Thank you sir! Your video was very helpful to me!
Glad it helped
Thank you! Great quick video!
You're welcome!
u just know the solution but u cant explain it
NICE SUPER EXCELLENT MOTIVATED
All the best
NICE SUPER EXCELLENT MOTIVATED
I am also in uae and searching for java developer position having 1.9 yrs of experience in IBM india, if you can help in placement in dubai it will b helpful. Thank you i understand this question approch from your video.
NICE SUPER EXCELLENT MOTIVATED
Very well explained 👏
Glad it was helpful!
I didn't even understand the problem description. After your initial beautiful explanation, I was able to code it myself! Thanks :)
Great to hear!
wonderful solution sir I was watching 2-3 videos before and none of the approach was understandable and after watching yours I coded myself.
Great to hear!
Damn bro! the explanation was so neat!! keep it up
for the algorithm.Thanks
i"ll be using this algorithm in my assignment, i'll edit my comment if i got A+
yes me too!!! (i'm with him in the group assignment)
Thank you very much.
Welcome 😊
Thank you! Great reasources
Glad it was helpful!
class Solution { public: int length (ListNode *&l){ int cnt = 0; ListNode *t = l; while(t){ t = t->next; cnt++; } return cnt; } void addZero(ListNode *&l,int cnt){ ListNode *add = new ListNode(0); ListNode *b = add; cnt--; while(cnt > 0){ cnt--; ListNode *n = new ListNode(0); add -> next = n; add = n; } add -> next = l; l = b; } void addll(ListNode *&l1,ListNode *&l2,int& cnt){ if(!l1 && !l2)return ; addll(l1->next,l2->next,cnt); int sum = l1->val+l2->val+cnt; cnt = sum / 10; l1 -> val = sum % 10; } ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { int c1 = length(l1); int c2 = length(l2); int l = abs(c1-c2); if(c1 > c2) addZero(l2,l); else if(c1 < c2) addZero(l1,l); int c = 0; addll(l1,l2,c); if(c){ ListNode *n = new ListNode(1); n -> next = l1; l1 = n; } return l1; } };
great thank you
While very simple it's pretty elegant to encode unbalanced as -1. The boolean statement could even be height(root) >= 0, which reads really well.
count = (k-1)*m ?? not understood this code
Time complexity here is O(n) is because you do not sort the result. Actually your final answer is not sorted that is not correct they expect final array should be sorted so you need to sort the array at the end and that is why time Complexity is Onlogn Please correct me If I'm wrong
hey How did you come on the formula for chunk ? whats the logic
what a champ, happy I did not have to do this problem on my own ❤🔥
working java code: class Solution { public TreeNode construct(int[] pre, int preStart, int preEnd, int[] post, int postStart, int postEnd, HashMap<Integer, Integer> map) { if(preStart > preEnd) return null; TreeNode root = new TreeNode(pre[preStart]); if(preStart == preEnd) return root; // when there is only one node in left or right subtree int postIdx = postStart; postIdx = map.get(pre[preStart+1]); // preStart+1 bcz we can determine left and right subtree nodes by checking the pos of next node in preOrder in postorder int len = postIdx-postStart +1; root.left = construct(pre, preStart+1, preStart+len, post, postStart, postIdx, map); root.right = construct(pre, preStart+len+1, preEnd, post, postIdx+1, postEnd-1, map); return root; } public TreeNode constructFromPrePost(int[] preorder, int[] postorder) { HashMap<Integer, Integer> map = new HashMap<>(); int n = postorder.length; for(int i = 0; i < n; i++) { map.put(postorder[i], i); // indx, value } return construct(preorder, 0, n-1, postorder, 0, n-1, map); } }
Thanks
Welcome
ty
The idea is brilliant, but kind of slow. Here are two approaches - approach 1 - def increasingTriplet(self, nums: List[int]) -> bool: num1 = num2 = float('inf') for n in nums: if n <= num1: num1 = n elif n <= num2: num2 = n else: return True return False approach 2 - the one explained in this video [Note that, I am using only 1 pass to find both leftMin array and rightMax array] def increasingTriplet(self, nums: List[int]) -> bool: leftMin, rightMax = [], [] n = len(nums) j = n-1 minVal, maxVal = float('inf'), float('-inf') for i in range(0, n): minVal = min(minVal, nums[i]) maxVal = max(maxVal, nums[j]) leftMin.append(minVal) rightMax.append(maxVal) j-=1 for i in range(n): if nums[i]>leftMin[i] and nums[i]<rightMax[n-i-1]: return True return False
I cant thank you enough sir!!! The explanation was absolutely amazing!!!! I didnt have a doubt even for a second!! Thank you so much sir!!!
You're very welcome!
Its fine but the explanation part can be better
Insted of break if we return score there than no need of maxScore
I saw 4...5 videos before watching your video sir.....great explanation....tnx👏
Keep watching
This is not dfs but a normal recursive function to iterate the hashmap Dfs deals with a map inside the node and go recursive with the next next nodes.
Thank You So Much for this wonderful answer.............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Most welcome 😊
class Solution { public: int bitwiseComplement(int n) { if(n==0) return 1; int i = 0; int ans = 0; while(n>0){ int bit = n&1; if(bit==0){ ans = ans+pow(2,i); } n = n>>1; i++; } return ans; } };
Simple Explanation ❤
Thank you 🙂
Can someone explain (p - 1) /k +1 ? I solved it using time = p /k ; if p % k !=0 then time++ My approach of calculating time is worse than this simple formula, which i dont yet understand. I know that if you divide some natural number by number N, that the maximum remainder can be N - 1.
wow. Never throught of that.
You are the king of this problem explanation. Thank you very much.
You are most welcome
beauty
Explanation is not good, it could have been better. Please try to improve.
Please come with stack ,queue, linkedlist problems more in java
u r awesome, much better than neetcode, strive solution
naresh you also started vlogging
Great video, thank you!
My pleasure!