two pointer

LeetCode - String Compression - Day15 (1/15/2020)

String Compression Question Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should be a character (not int) of length 1…

LeetCode - Move Zeros - Day1 (1/1/2020)

Move Zeros Question Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: [0,1,0,3,12] Output: [1,3,12,0,0] Note: You must do this in-place wit…