Leetcode Solutions 5781. Remove All Occurrences of a Substring

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 42

  • @SaurabhJeena-sh4gh
    @SaurabhJeena-sh4gh Месяц назад

    class Solution {
    public String removeOccurrences(String s, String part) {
    StringBuilder str=new StringBuilder();
    for(int i=0;i=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

  • @navneetkumarkushwaha5689
    @navneetkumarkushwaha5689 9 месяцев назад +1

    Good Approach. Sir

  • @shubhamhire9390
    @shubhamhire9390 2 года назад +1

    The explanation was amazing 🔥🔥🔥

  • @shresthjain7557
    @shresthjain7557 Год назад

    such an easy explanation!!!

  • @rishitiwari6200
    @rishitiwari6200 3 года назад +4

    Bhaiya ek bhi nhi hua tried 30 minutes a and 1 hour B no results b me toh runtime hi aate reh gya bhttc me using s.erase aur A me wa feeling very demotivated hope to do 1-2 tomorrow in weekly

    • @mohammadfraz
      @mohammadfraz  3 года назад

      All the best for tomorrow, you will do better

  • @nitin5865
    @nitin5865 3 года назад +1

    Thanks a ton bhaiya, I haven't thought of stack here 🤦

  • @yatharthbajaj3978
    @yatharthbajaj3978 3 года назад +1

    Day 19:3quesrions
    Total:105

  • @yourbestie4138
    @yourbestie4138 3 года назад +2

    It was very helpful sir!!,I was able to solve 3 questions during yesterdays contest so am i somewhat at good level sir?
    Suggest me some ideas so that i can consistently solve 3-4 questions on leetcode contests

    • @mohammadfraz
      @mohammadfraz  3 года назад

      You are doing good. Keep practicing

  • @rajgupta5158
    @rajgupta5158 3 года назад +1

    3rd question is based on dp in which I not so good, Sir can you provide some tips to me to do at least 3 questions because I got a stack to solve only 2 problems in each contest except very few contest this thing very demotivated for me.

    • @mohammadfraz
      @mohammadfraz  3 года назад

      I told everything in video bro , I provided resources also

  • @shanumishra4930
    @shanumishra4930 3 года назад

    Day 19: 3 ques..including this ques
    Total: 183

  • @agree.
    @agree. 3 года назад

    Was waiting for it

  • @sahilbhaiya6200
    @sahilbhaiya6200 3 года назад

    Helpful video 👍

  • @Code_Note
    @Code_Note 3 года назад

    Bhaiya I had this question in mind why doesn't leetcode gives the access to see the submissions of others because many a times we write buggy codes which somehow sometimes passes test cases (generally weak test cases).So if we can access the submissions of top in ranklist then we can debug our code as well and stress testing to find such cases.

    • @mohammadfraz
      @mohammadfraz  3 года назад

      No they don't allow access to other's cases

  • @mohdtabish_1
    @mohdtabish_1 Год назад

    string removeOccurrences(string s, string part) {
    while(s.find(part)!=-1){
    s.erase(s.find(part),part.size());
    }
    return s;
    }

  • @ayushthakur2896
    @ayushthakur2896 3 года назад

    can we reduce the TC by using KMP?

  • @abhaytiwari6411
    @abhaytiwari6411 3 года назад

    4th questions of biweekly 55 is hard please solve it

  • @gautamarora6556
    @gautamarora6556 3 года назад

    Day 19: 3 ques
    Total: 239

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 3 года назад

    Have you done Competitive programing just want some reviews on that

  • @shivam_dhyani
    @shivam_dhyani 3 года назад

    Bhaiya this problem number is 1910!!
    Please check it once!

    • @mohammadfraz
      @mohammadfraz  3 года назад +1

      This is the numbering during contest. I will update it

    • @shivam_dhyani
      @shivam_dhyani 3 года назад

      @@mohammadfraz yes bhaiya it was, but now they have changed.
      Thank you for replying, you are doing a great work for CS Community. 🙏
      Just one suggestion, is that, please make the video solution more comprehensive, so that beginners can also take advantage of your videos. ☺

  • @rishabhdevbanshi9780
    @rishabhdevbanshi9780 3 года назад

    Day 19 : solved 3 ques on Leetcode and 2 ques on GFG

  • @mohammedwaseem8599
    @mohammedwaseem8599 3 года назад

    Bro what is mean by OA??

  • @04_itsanskaragarwal73
    @04_itsanskaragarwal73 Год назад

    Incomplete coding explanation try to complete the entire things