All Posts

1575 articles

dsa3 min read

Design Twitter

Design a simplified Twitter with follow/unfollow and a news feed showing the 10 most recent tweets from followed users.

Read →
dsa2 min read

Ugly Number III

Find the nth number divisible by a, b, or c using binary search with inclusion-exclusion counting formula.

Read →
dsa2 min read

Maximum Performance of a Team

Maximize team performance (sum of speeds * min efficiency) by sorting by efficiency and using a min-heap on speeds.

Read →
dsa2 min read

Longest Happy String

Build the longest string with at most 2 consecutive identical characters by always using the most frequent available character.

Read →
dsa2 min read

Maximum Frequency Stack

Design a stack that pops the most frequent element, breaking ties by most recently pushed, using frequency-bucket stacks.

Read →
Page 132 of 315