Given non-empty array nums of intergers and a val integer, update the array so that all occurances of the input val have been removed and the remaining elements have been shifted to fill the emptied indices. Do this without using extra space.
Expected runtime: O(n)
Example:
nums: [4, 4, 3, 8, 6, 5, 6, 2, 8, 4, 6, 1]
val: 4
Returns nothing, but the new value of the nums array looks like:
[3, 8, 6, 5, 6, 2, 8, 6, 1]
NO. I do not want the crappy LeetCode question that just returns the "new length". I can't even express my frustration at how stupidly ridiclous that question is. That question had an opportunity to really create some interesting opprtunities and approaches, but instead we were fed some "trick."