Find All Numbers Disappeared in an Array in Java
This is a good example of using the input array itself as bookkeeping space. The numbers are constrained to 1..n, which means each value can point to one mea...
This is a good example of using the input array itself as bookkeeping space. The numbers are constrained to 1..n, which means each value can point to one mea...
This is a clean array-compaction problem. The important requirement is not just “put zeroes at the end” but “keep the non-zero elements in the same order.”
This is one of the cleanest bit-manipulation problems. The whole solution comes from one idea: duplicate values cancel under XOR.
This is a foundational tree problem because it can be solved cleanly in both DFS and BFS style. The recursive DFS version is the most compact, while BFS make...
This variant is more subtle than the simpler sorted-list deduplication problem. We are not keeping one copy of repeated values. We are removing every value t...