Surinder Kumar’s Post

Day 61/100 of #100DaysOfCode Today I worked on a basic string problem and also explored a higher-level problem related to optimization. First, I solved a string problem: removing spaces from a given string. Initially, it felt simple, but while coding I understood the importance of clear thinking. Key learning: Focus on characters we want to keep Traverse the string using a loop Build a new result string without spaces Example: Input: "geeks for geeks" Output: "geeksforgeeks" This strengthened my understanding of how to convert logic into code step-by-step. Along with this, I also looked at a more advanced problem involving robots and factories. Even though I didn’t fully implement it, I understood the core idea: Robots are placed on a line and need to reach factories Each factory has a limit on how many robots it can repair The goal is to assign robots to factories such that the total distance traveled is minimum The approach involves: Thinking in terms of assigning closest possible robots Considering constraints like factory limits Understanding that sometimes simple greedy logic is not enough Learning that advanced techniques like sorting and dynamic programming are used to find the optimal solution This made me realize how problems can evolve from simple logic to complex optimization, and how important it is to build a strong foundation before jumping into advanced topics. Still learning, still improving — one concept at a time. #coding #dsa #learning #100daysofcode

  • text, letter

To view or add a comment, sign in

Explore content categories