Leetcode 1531 String Compression II
19:01
Leetcode 2050 Parallel Courses III
14:21
Leetcode  2742  Painting the Walls
18:45
Leetcode 542 01 Matrix
6:18
Жыл бұрын
Leetcode 63 Unique Paths II
6:59
Жыл бұрын
Leetcode 518 Coin Change II
9:14
Жыл бұрын
LeetCode 46 Permutations Java
7:37
Leetcode 77 Combinations
9:57
Жыл бұрын
Leetcode 486 Predict the Winner
10:29
Пікірлер
@anasmunaf7395
@anasmunaf7395 4 күн бұрын
i found this helpfull amongst many others
@nagendravinayravisetti-jc6yv
@nagendravinayravisetti-jc6yv 14 күн бұрын
Nice explanation i didn't get line If prev not null then prev. Next null at the end
@yogendrakesharwani3650
@yogendrakesharwani3650 17 күн бұрын
Very impressive no time pass directly straight to the point with crisp and clear explaination
@JeevanKumar-code
@JeevanKumar-code 17 күн бұрын
@@yogendrakesharwani3650 Thank you!!
@saikiran1426
@saikiran1426 Ай бұрын
Nice explanation, underrated
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
@@saikiran1426 Thank you!!
@vineethkumar8094
@vineethkumar8094 Ай бұрын
Thanks for your wonderful video..May i have your contact number pls..
@helloworld9118
@helloworld9118 Ай бұрын
solved it yesterday nice problem 42ms😢
@BALAIT2020
@BALAIT2020 Ай бұрын
super super explanation sir..
@AmAnKumAr-tg4fy
@AmAnKumAr-tg4fy Ай бұрын
why you are adding k in arr[i] % k, I don't get it (in -1 % 3 example)
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
In some languages like Java -1%4 will give you -1, which is wrong (as remainder should always be +ve by definition). so we add -1+4 = 3. However in other languages like python -1%4 will give you 3 directly.
@AmAnKumAr-tg4fy
@AmAnKumAr-tg4fy Ай бұрын
@@JeevanKumar-code thanks
@kunalsharma8985
@kunalsharma8985 Ай бұрын
good one these videos are helpful to get an idea of the problem but still solve it by self. keep them rolling!!!
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
Thank you!!
@bipulasarcomilla9105
@bipulasarcomilla9105 Ай бұрын
Welcome back!
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
Thank you!!
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
Code Link: leetcode.com/problems/all-oone-data-structure/discuss/5845899/Map-and-Set-or-Easy-Detailed-Explaination-with-Video
@sharonbaby3229
@sharonbaby3229 Ай бұрын
i didn't get that code where is it
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
Have added it in the comments
@nikitasharma4316
@nikitasharma4316 Ай бұрын
amazing
@JeevanKumar-code
@JeevanKumar-code Ай бұрын
Thank you!
@MennaTullahabdelrahman
@MennaTullahabdelrahman 3 ай бұрын
that is really appreciated. Thank you.
@sunilchormale4655
@sunilchormale4655 3 ай бұрын
Time Complexity is O(N^2).
@elitzayotkova9796
@elitzayotkova9796 3 ай бұрын
Great Explanation!
@BlackshipCoder
@BlackshipCoder 3 ай бұрын
Can we solve this problem using binary search approach ?
@tarunyadav6617
@tarunyadav6617 3 ай бұрын
Just too good and too simple THANKS BUDDY!!!!
@shreyarawatvlogs6920
@shreyarawatvlogs6920 4 ай бұрын
4.22 where did 7 came from. i didnt understood
@subee128
@subee128 4 ай бұрын
Thanks
@JeevanKumar-code
@JeevanKumar-code 4 ай бұрын
Welcome! I am glad you liked it.
@subee128
@subee128 4 ай бұрын
Thanks
@eyob_worku
@eyob_worku 4 ай бұрын
you are the best
@JeevanKumar-code
@JeevanKumar-code 4 ай бұрын
Thank you!
@shriramnirmal5535
@shriramnirmal5535 4 ай бұрын
why are we initialising 0 with count 1 , I couldn't understand that point
@shriramnirmal5535
@shriramnirmal5535 4 ай бұрын
okay got it this 0 is for say like if the sub array is a total array then we should have a value in hash map zero
@subee128
@subee128 4 ай бұрын
thanks
@kirant5548
@kirant5548 5 ай бұрын
You explained it very nicely. Looking forward to more videos
@devilhorn
@devilhorn 5 ай бұрын
but what if the [0,0] is not 0?
@mathavansg9227
@mathavansg9227 5 ай бұрын
how to think of this logic sir ?
@veljkomarkovic9029
@veljkomarkovic9029 5 ай бұрын
Keep it going ! :D
@Apeuda
@Apeuda 5 ай бұрын
you explained the steps but you didn't explain how and why it works
@shravyapentaparthi7018
@shravyapentaparthi7018 5 ай бұрын
Can you please share the time and space complexities as well
@mdibrahimalif6961
@mdibrahimalif6961 6 ай бұрын
what's the app you using to note?
@JeevanKumar-code
@JeevanKumar-code 6 ай бұрын
Fresher's Community Link: chat.whatsapp.com/CsvgJRFNZTQAIcujub1gDe Experienced Community Link: chat.whatsapp.com/IeeHQGlUPK25OFm7mIdv5G
@sandip_kanzariya8476
@sandip_kanzariya8476 6 ай бұрын
Keep it up man !
@JeevanKumar-code
@JeevanKumar-code 6 ай бұрын
Thank you!
@SHARAND-e7t
@SHARAND-e7t 6 ай бұрын
Hey bro, will you be uploading answer of daily challenges everyday? and good approach!
@JeevanKumar-code
@JeevanKumar-code 6 ай бұрын
Yes Sharan I will be uploading solution for the medium and Hard level problems. Thank you!
@JeevanKumar-code
@JeevanKumar-code 6 ай бұрын
Telegram Links: t.me/+FieKB7Ds6j02Y2Y1 t.me/+JU-ZF-oDjX4xYjBl
@JeevanKumar-code
@JeevanKumar-code 6 ай бұрын
Similar Problems: leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree/ leetcode.com/problems/binary-tree-cameras/
@muartem
@muartem 6 ай бұрын
Please improve your pronunciation. I can’t listen you.
@aryastark4064
@aryastark4064 7 ай бұрын
why didnt you finish the seaies.. this is exactly what I was looking for
@kufirre
@kufirre 7 ай бұрын
Good explanation
@chewbaca6971
@chewbaca6971 7 ай бұрын
Like the explaination but solution is far from ideal and will timeout if run with higher inputs
@Ani_86_
@Ani_86_ 7 ай бұрын
Nice explanation
@himanshurathore9423
@himanshurathore9423 8 ай бұрын
best explaination for the java submission
@adarshanand7204
@adarshanand7204 8 ай бұрын
00:02 Problem requires step-by-step approach 02:20 Finding the shortest path to collect all keys 04:43 Path to obtaining keys to unlock cells. 07:03 Using binary representation to store key configurations efficiently 09:15 Using numbers to represent key configurations simplifies identification 11:37 Algorithm for finding shortest path to get all keys. 13:49 Finding the shortest path to get all keys with specific conditions. 16:03 Traversal and key management in pathfinding algorithm. 18:00 Iterating over elements in the queue and updating steps
@ridj41
@ridj41 9 ай бұрын
code for pair ?
@yuktihanduja3353
@yuktihanduja3353 9 ай бұрын
brute force solution is incorrect. It will fail on the test case [1,100,5]. Explanation: One possible case is when player 1 picks 5. Player 2 picks 1. Player 1 picks 100. This situation will arise because you are considering all possible cases and this case will also fall under it. Your solution will return true but expected answer is false
@thomasaminer
@thomasaminer 10 ай бұрын
Thank you for your explanation! It's better than on many other channels!
@tejaswinigondane8639
@tejaswinigondane8639 11 ай бұрын
in 10:19 why to take a2 for a7 and for a10 to a3 I did'nt understand this
@JeevanKumar-code
@JeevanKumar-code 11 ай бұрын
It's the length of the new String i.e a7 has a length of 2 and a10 has a length of 3
@kentnar2652
@kentnar2652 11 ай бұрын
This is my java solution: Logically It makes sense to me but I am having trouble with the testcases, any pointers will help: class Solution { public int getLengthOfOptimalCompression(String s, int k) { int[][] x = new int[s.length() + 1][k + 1]; for(int[] j : x){ Arrays.fill(j, -1); } return find(s, k, 0, x, Character.MIN_VALUE, 0); } int find(String s, int k, int index, int[][] x, char cur, int charcount){ if(k == 0 || index >= s.length()){ return Calculate_len(s, index); } if(x[index][k] != -1){ return x[index][k]; } int count = 0; if(cur != s.charAt(index)){ String num = String.valueOf(charcount); int val = 0; if(num.equals("1")){ val = 1; } else if(num.equals("0")){ val = 0; } else{ val = num.length() + 1; } // System.out.println(num + " " + val); count = Math.min(find(s, k, index + 1, x, s.charAt(index),1) + val, find(s, k - 1, index + 1, x, cur, charcount)); } else{ count = Math.min(find(s, k, index + 1, x, s.charAt(index),charcount + 1), find(s, k - 1, index + 1, x, cur, charcount)); } x[index][k] = count; // System.out.println(x[index][k] + " " + index + " " + k); return x[index][k]; } int Calculate_len(String s, int index){ if(index >= s.length()){ return 0; } String ns = s.substring(index); int i = 0; int fin_count = 0; while(i < ns.length()){ int count = 1; while(i < ns.length() - 1 && ns.charAt(i) == ns.charAt(i + 1)){ count++; i++; } if(count == 1){ fin_count++; } else{ String num = String.valueOf(count); fin_count += (num.length() + 1); } i++; } return fin_count; } }
@JeevanKumar-code
@JeevanKumar-code 11 ай бұрын
Check out our community of 400+ people: t.me/+FieKB7Ds6j02Y2Y1
@RohanKumar-s5q
@RohanKumar-s5q 11 ай бұрын
class Solution { public: int dp[102][102]; int find(int n){ if(n==1) return 1; if(n>1 and n<10) return 2; if(n>=10 and n<100) return 3; return 4; } int solve(string &s,int k,int idx){ if(k<0) return s.size(); if(idx>=s.size() || (s.size()-idx)<=k) return 0; if(dp[idx][k]!=-1) return dp[idx][k]; int ans=s.size(); ans=solve(s,k-1,idx+1); int cons=0,cnt=0,j; for( j=idx;j<s.size() && cnt<=k;j++){ if(s[j]==s[idx]) cons++; else{ ans=min(ans,find(cons)+solve(s,k-cnt,j)); cnt++; } } if(cnt<=k) ans=min(ans,find(cons)+solve(s,k-cnt,j)); return dp[idx][k]=ans; } int getLengthOfOptimalCompression(string s, int k) { memset(dp,-1,size(dp)); return solve(s,k,0); } }; what is the error in my code