🌀 Leetcode 54: Spiral Matrix
Traverse a 2D matrix in a spiral order 👉 right, down, left, up — repeat!
Tip: Use top, bottom, left, right boundaries & shrink them as you go.
Watch out for off-by-one errors! 😅
#Leetcode#Java#Coding#100DaysOfCode
🔥 Solved Leetcode 234: Palindrome Linked List
🧠 Used two-pointer technique to find the middle
🔁 Reversed the second half
🔍 Compared both halves to check for palindrome
💡 Time: O(n), Space: O(1)
#Leetcode#100DaysOfCode#DSA#Java#LinkedList
🐒 LeetCode 875 – Koko Eating Bananas
Koko eats 🍌 at speed k. Find the minimum speed so she finishes all piles in h hours.
Trick: (pile + speed - 1) / speed avoids Math.ceil()
#LeetCode#Java#BinarySearch#100DaysOfCode#DSA
✅ LeetCode 1961 – Check If String Is a Prefix of Array
Passed all test cases! 🧪💯
🧠 Logic: Build the prefix step-by-step using StringBuilder & compare with s. Exit early if it goes too long.
#LeetCode#Java#100DaysOfCode#CodingJourney#DSA
📌 Code: Given Below
Solved LeetCode 27 – Remove Element with a 🔁 two-pointer swap trick!
Remove all val occurrences in-place without extra space 👇
🧠 Think smart with pointers!
#LeetCode#Java#Coding#DSA#100DaysOfCode
🧠 #Leetcode 153: Find Minimum in Rotated Sorted Array
✅ Use #BinarySearch 🎯 Focus on the unsorted half to find the minimum 💡 Condition: if mid > end ➡️ min is in right Else ➡️ min is in left (including mid)
⏱️ Time: O(log n)
#Coding#Java#DSA