Day 23 of APEX 151
Today’s one: Permutation in String — LC 567
The key was keeping a fixed-size window and comparing character frequencies instead of generating permutations
23/151
Day 22 of APEX 151
Today’s one: Minimum Size Subarray Sum — LC 209
Expand the window until the sum reaches the target, then shrink it from the left to find the smallest valid window
22/151
Day 21 of APEX 151
Today’s one: Longest Substring Without Repeating Characters — LC 3
Sliding window + tracking the last index of each character. The key was moving the left pointer directly instead of checking the whole window again
21/151
Day 20 of APEX 151
Today’s one: Trapping Rain Water — LC 42
Two pointers + keeping track of the highest wall on both sides
Time: O(n)
Space: O(1)
20/151
Day 19 of APEX 151
Today’s one: 3Sum — LC 15
This one felt like a proper step up💀
Sorted the array, fixed one number, then used two pointers to find the other two. Also had to handle duplicates carefully so the same triplet doesn't show up twice
19/151
Day 18 of APEX 151
Today’s one: Valid Palindrome — LC 125
Two pointers, but with a little cleanup along the way
Skipped non-alphanumeric characters, compared everything case-insensitively, and kept moving inward
18/151
Day 17 of APEX 151
Today’s one: Product of Array Except Self — LC 238
Just two passes:
→ Prefix products
→ Suffix products
The trick was realizing the answer can be built while calculating both
17/151
Got my Bharat Builds 2026 badge!
Officially participating in the WeMakeDevs × AWS Bharat Builds Tour.
Now it's time to build something.
#BharatBuilds#AWS#WeMakeDevs#Hackathon
Day 16 of APEX 151
Today’s one: Subarray Sum Equals K — LC 560
Prefix sums + HashMap
At first, the total - k part felt a little confusing, but once the prefix-sum idea clicked, the solution made a lot more sense
16/151
Day 15 of APEX 151
Today’s one: Longest Consecutive Sequence — LC 128
The interesting part was getting O(n) without sorting the array
Used a HashSet and only started counting when the current number was the start of a sequence
15/151
Day 14 of APEX 151
Today’s one: Two Sum — LC 1
A classic, but this time I focused on the HashMap approach
Instead of checking every possible pair, store what we've already seen and look for the number we need
Simple idea. Big difference.
14/151
Day 13 of APEX 151
Today’s one: Shortest Palindrome — LC 214
The key was finding the longest palindromic prefix, then figuring out what needs to be added in front
Not going to lie, this one took some time to click
13/151