Leetcode 2578 Split With Minimum Sum
18:18
Пікірлер
@SaifKhan-vv9ol
@SaifKhan-vv9ol Сағат бұрын
why don't you use binarySearch for left side
@SaurabhJeena-sh4gh
@SaurabhJeena-sh4gh 28 күн бұрын
class Solution { public String removeOccurrences(String s, String part) { StringBuilder str=new StringBuilder(); for(int i=0;i<s.length();i++){ str.append(s.charAt(i)); int j=str.length()-part.length(); if(j>=0&&str.substring(j).equals(part)){ str.setLength(j); } } return str.toString(); } } runs in 5 ms time done by myself had a great boost in confidence ..code is small but it took me 6 hours to come up to this solution
@moein7808
@moein7808 Ай бұрын
Easy to understand. Thanks man .
@maksrane100
@maksrane100 Ай бұрын
Glad it helped
@shubhamk840
@shubhamk840 2 ай бұрын
Hey, This is the best explanation for this question. That DP table made all of my doubts cleared.
@maksrane100
@maksrane100 2 ай бұрын
Glad it helped....
@rajkumarwinc9372
@rajkumarwinc9372 2 ай бұрын
Eclipse debug window is not showing in video
@akilhossain1415
@akilhossain1415 2 ай бұрын
Excellent explanation!!!!
@maksrane100
@maksrane100 2 ай бұрын
Glad it was helpful!
@thesituationaccepter
@thesituationaccepter 2 ай бұрын
very good explained😊
@maksrane100
@maksrane100 2 ай бұрын
Thanks for liking
@sumeethmoolya8773
@sumeethmoolya8773 3 ай бұрын
Nice Solution and code.
@maksrane100
@maksrane100 2 ай бұрын
Glad you like it
@Bms.edit.s20
@Bms.edit.s20 3 ай бұрын
code- public static boolean iscycle(boolean[] visited,Map<Integer,Boolean> map,int graph[][],int curr ){ if(map.containsKey(curr)) return map.get(curr); if(visited[curr]){ return false; } visited[curr]=true; for(int i: graph[curr]){ if(iscycle(visited, map, graph, i)) map.put(i, true); else return false; } visited[curr]=false; return true; } public static List<Integer> eventualSafeNodes(int[][] graph) { int size=graph.length; boolean visited[] =new boolean[size]; @SuppressWarnings("rawtypes") Map<Integer,Boolean> map=new HashMap(); List<Integer> L=new ArrayList<>(); for(int i=0;i<size;i++){ if(graph[i].length==0) map.put(i, true); } for(int i=0;i<size;i++){ boolean result=iscycle(visited, map, graph, i); map.put(i, result); } for(int i=0;i<size;i++){ if (map.get(i)) L.add(i); } return L; }
@jailudhani8841
@jailudhani8841 3 ай бұрын
That many DFS method, definitely give wrong impression to interviewer
@dphdmn
@dphdmn 3 ай бұрын
Oh, so just reverse dfs, makes sense! Sadly would not scale really well on higher sized puzzles I think you need 20 TB of memory to make it work at classical 4x4
@tejaltatiwar4682
@tejaltatiwar4682 3 ай бұрын
excellent
@maksrane100
@maksrane100 2 ай бұрын
Thanks!
@vedbhanushali608
@vedbhanushali608 3 ай бұрын
nice solution thanks
@maksrane100
@maksrane100 2 ай бұрын
Happy to help
@PratikJadhav-f1w
@PratikJadhav-f1w 3 ай бұрын
Thanks i was bit conf
@surojitjana8682
@surojitjana8682 3 ай бұрын
the code doesnot pass all the test cases!!
@surojitjana8682
@surojitjana8682 3 ай бұрын
what will happen if a B is surrounded by G in all four sides?
@xVyfAORkf
@xVyfAORkf 3 ай бұрын
Doesn't is consider that plus have only one good cells?
@JohnWick-v1n
@JohnWick-v1n 3 ай бұрын
Thank you sir crystal clear explanation
@maksrane100
@maksrane100 2 ай бұрын
You are welcome
@sanilpatwa9595
@sanilpatwa9595 3 ай бұрын
Nice solution
@maksrane100
@maksrane100 2 ай бұрын
You are welcome
@Patrick-x3g9i
@Patrick-x3g9i 3 ай бұрын
This is such a clean and understandable code, thanks
@FactOpia784
@FactOpia784 4 ай бұрын
i still didnt understand why we decremented b count
@sansritimishra9859
@sansritimishra9859 4 ай бұрын
Thank you
@maksrane100
@maksrane100 2 ай бұрын
You are welcome
@SHUBHAMVARDAAN
@SHUBHAMVARDAAN 4 ай бұрын
worst video, presenter is very confused about what he is presenting .
@ramswrooppatidar7599
@ramswrooppatidar7599 4 ай бұрын
if(left[1] >= root.val || right[0] <= root.val){ return new int[]{Integer.MIN_VALUE, Integer.MAX_VALUE, 0}; // return new int[]{0, 0, 0}; } i not undersatnd, if minimum is set to Integer,Min AND MAXIMUM IS SET tO iN.MAX , THAN how it is working , for max and maxsum ??
@minakshiganganpure-hg5zf
@minakshiganganpure-hg5zf 4 ай бұрын
Rani
@kaihiwatari7133
@kaihiwatari7133 4 ай бұрын
I bet Takahashi's teeth won't be happy with all these candies..
@sherazdotnet
@sherazdotnet 4 ай бұрын
Time Complexity?
@thAsciNileshPal
@thAsciNileshPal 4 ай бұрын
very bad explanation ,nhi samjha kuch
@prakashpratapsingh7323
@prakashpratapsingh7323 4 ай бұрын
Tu rehne de bhai😅
@AshwiniYeokar
@AshwiniYeokar 5 ай бұрын
Very easy to understand. Thank you😊
@maksrane100
@maksrane100 2 ай бұрын
You are welcome
@javaguru7453
@javaguru7453 5 ай бұрын
Thank you
@maksrane100
@maksrane100 5 ай бұрын
You're welcome
@aakankshasahu4312
@aakankshasahu4312 5 ай бұрын
Amazing explanation
@maksrane100
@maksrane100 5 ай бұрын
Glad it was helpful!
@Chandrasekhar-in4ym
@Chandrasekhar-in4ym 6 ай бұрын
Great explanation brother than you
@maksrane100
@maksrane100 6 ай бұрын
You are welcome
@jasonchen8566
@jasonchen8566 6 ай бұрын
excellent explanation!
@maksrane100
@maksrane100 6 ай бұрын
Glad it was helpful!
@ScamMicrosoft-of5ln
@ScamMicrosoft-of5ln 6 ай бұрын
i like it your chanal, i want to solve all question of DSA. that's why i'll show your all video. nice work. thak for videos.
@maksrane100
@maksrane100 6 ай бұрын
Glad it helped..
@workerwatch3473
@workerwatch3473 7 ай бұрын
Very clear explanation ! Great
@maksrane100
@maksrane100 7 ай бұрын
Glad it was helpful!
@biswaMastAadmi
@biswaMastAadmi 7 ай бұрын
Thanks man !
@maksrane100
@maksrane100 7 ай бұрын
Happy to help
@hello_california
@hello_california 7 ай бұрын
Invisible video detected!)😂
@shoaibakhtar9194
@shoaibakhtar9194 8 ай бұрын
Good explanation
@maksrane100
@maksrane100 8 ай бұрын
Thanks for liking
@YelsonVivas
@YelsonVivas 8 ай бұрын
Thank you good work
@maksrane100
@maksrane100 8 ай бұрын
Always welcome
@anonymous-sz8jq
@anonymous-sz8jq 9 ай бұрын
nice explanation sir, keep posting content like this
@maksrane100
@maksrane100 9 ай бұрын
Thank you, I will