DSA - 1 new, 2 revision (Hashing, Linked List, Strings)
π Todayβs Progress
1 New β’ 2 Revisions
New Problem
49. Group Anagrams
Insight: Sort characters of each word and use it as a key in a hashmap to group anagrams.
Comment: Easy overall, but needed a hint to recall the sorting trick.
Observation (JS Quirk):
arr.sort()sorts alphabetically (case-sensitive) by default- For numbers β
(a, b) => a - bworks - For alphabets β direct sort works, comparator logic differs
Revisions
21. Merge Two Sorted Lists
Insight:
Used standard linked list template:
dummy,curr, andheadpattern- Traverse using
curr - Return
dummy.next - Append remaining nodes after one list ends
Comment: Felt straightforward β template becoming natural.
271. Encode and Decode Strings
Insight:
- Use length prefixing for each string
- Add delimiter between length and string
- Carefully handle empty strings and edge cases
- Pointer movement is key
Comment: Getting more comfortable managing pointers and parsing logic.
π Reflection
Good, productive day overall.
Balanced problem-solving with understanding patterns instead of just solving.
Had the mid-sem dissertation viva β went well, and the progress so far feels solid.
Got an interesting push from the examiner to write a research paper based on this work.
Thatβs something worth exploring seriously.
Momentum is building β‘