Remove every occurrence of val from nums in place and return the count k of remaining elements. Two approaches, same problem — switch between them and watch how each rearranges the array.
nums
k