Nice explanation i didn't get line If prev not null then prev. Next null at the end
@yogendrakesharwani365017 күн бұрын
Very impressive no time pass directly straight to the point with crisp and clear explaination
@JeevanKumar-code17 күн бұрын
@@yogendrakesharwani3650 Thank you!!
@saikiran1426Ай бұрын
Nice explanation, underrated
@JeevanKumar-codeАй бұрын
@@saikiran1426 Thank you!!
@vineethkumar8094Ай бұрын
Thanks for your wonderful video..May i have your contact number pls..
@helloworld9118Ай бұрын
solved it yesterday nice problem 42ms😢
@BALAIT2020Ай бұрын
super super explanation sir..
@AmAnKumAr-tg4fyАй бұрын
why you are adding k in arr[i] % k, I don't get it (in -1 % 3 example)
@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Ай бұрын
@@JeevanKumar-code thanks
@kunalsharma8985Ай бұрын
good one these videos are helpful to get an idea of the problem but still solve it by self. keep them rolling!!!
Similar Problems: leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree/ leetcode.com/problems/binary-tree-cameras/
@muartem6 ай бұрын
Please improve your pronunciation. I can’t listen you.
@aryastark40647 ай бұрын
why didnt you finish the seaies.. this is exactly what I was looking for
@kufirre7 ай бұрын
Good explanation
@chewbaca69717 ай бұрын
Like the explaination but solution is far from ideal and will timeout if run with higher inputs
@Ani_86_7 ай бұрын
Nice explanation
@himanshurathore94238 ай бұрын
best explaination for the java submission
@adarshanand72048 ай бұрын
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
@ridj419 ай бұрын
code for pair ?
@yuktihanduja33539 ай бұрын
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
@thomasaminer10 ай бұрын
Thank you for your explanation! It's better than on many other channels!
@tejaswinigondane863911 ай бұрын
in 10:19 why to take a2 for a7 and for a10 to a3 I did'nt understand this
@JeevanKumar-code11 ай бұрын
It's the length of the new String i.e a7 has a length of 2 and a10 has a length of 3
@kentnar265211 ай бұрын
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-code11 ай бұрын
Check out our community of 400+ people: t.me/+FieKB7Ds6j02Y2Y1
@RohanKumar-s5q11 ай бұрын
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