Yogesh ..’s Post

Day 45/100 | #100DaysOfDSA 🚀🧩 Today’s problem: Remove All Occurrences of a Substring The task is simple: Given a string s and a substring part, keep removing the leftmost occurrence of part until it no longer exists in s. Approach: • Use StringBuilder for efficient modifications • Find the index of part using indexOf() • Delete that portion from the string • Repeat the process until part is no longer found Time Complexity: O(n × k) in worst case (where n is length of string and k is length of substring) Big takeaway: Sometimes the easiest solution is just repeating a simple operation until the condition disappears. Clean string manipulation problem today. 🔥 Day 45 done. #100DaysOfCode #LeetCode #DSA #Algorithms #Java #String #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories