Remove Duplicates from Sorted List (LeetCode 83)
This is one of the cleanest linked-list problems where sorted order removes most of the complexity. Because equal values appear next to each other, we can de...
This is one of the cleanest linked-list problems where sorted order removes most of the complexity. Because equal values appear next to each other, we can de...
This is a classic two-pointer optimization problem. The key challenge is not computing the area, but knowing which boundary can be safely moved without missi...
Binary search is one of the most reused patterns in algorithms, but it is also one of the easiest to get subtly wrong. Most bugs come from not being clear ab...
This is a linked-list version of grade-school addition. The main challenge is not arithmetic itself, but carrying digits correctly while the two lists may ha...
Cycle detection is a classic linked-list pattern because it turns an apparently tricky structural problem into a pointer-speed problem. Floyd’s algorithm is ...