Skip to content
the poor coder

Home / Topics / #two-pointers

#Two Pointers

9 posts
2021

Leetcode - Sort Colors Solution

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use the integers 0, 1, and 2…

2021

Leetcode - Remove Element Solution

Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1)…

ESC