π Day 58 of #100DaysOfCode
π― Solved: Reverse Words in a String
π‘ Topics: Two pointers, string manipulation
Funny how you can stack multiple while loops and still stay O(n) π
Separating the cleanup from the core logic made everything click.
π Day 57 of #100daysofcode
π― Solved: Set Matrix Zeroes
π‘ Topics: Matrices
Space complexity actually mattered in this one - a rare sight. Always fun when the problem makes you squeeze logic into O(1).
π Day 56 of #100daysofcode
π― solved: Sort Characters By Frequency
π‘ topics: hashmap, string, sorting
β‘ learning: Use reserve() when you know the final size - no reallocations, faster builds.
π Day 55 of #100daysofcode
π― solved: Remove duplicates
π‘ topics: easy two pointers
later realized that I had solved it once, so this was just a revision.
π Day 53 of #100daysofcode
π― solved: Reverse Integer
π‘ topics: Maths
Check overflow before it occurs while building the reversed number - donβt rely on final bounds check.
#DSA#LearnInPublic
π Day 52 of #100DaysOfCode
π Back after a long break.
Solved βKeep Multiplying Found Valuesβ.
πΉ Built an unordered_set from vector β O(n) avg
πΉ Each existence check β O(1) avg
πΉ Loop + double until not found.
#DSA#LearnInPublic
π¬ Hey working professionals!
Weβre doing a quick 5-min survey for our IITM BS coursework on workplace communication.
Your insights = super valuable! π
π https://t.co/kFB5vGNTUp
#Survey#Workplace#IITMBS#ProfessionalGrowth
π Day 50 of #100daysofcode
π― solved: Insert Interval
π‘ topics: Array
Since a new array is to be returned, O(N) is the best we can do, binary search also wont help.
#DSA#learninpublic
π Day 49 of #100daysofcode
π― solved: Minimum number of platforms required for a railway
π‘ topics: Greedy, Two pointer
Total platforms = max trains at any time.
Sort arrivals & departures separately, use two pointers to simulate arrival & departure.
#DSA#learninpublic
π Day 48 of #100daysofcode
π― solved: N meetings in one room
π‘ topics: Greedy
The sooner a meeting ends, the more room there is for other meetings.
#DSA#learninpublic