Leetcode – Remove Element

Name: Remove ElementDifficulty: EasyDescription: Remove all instances of val from nums, modify in place, return new count. Example: Input: nums = [0,1,2,2,3,0,4,2], val = 2 Output: 5, nums = [0,1,4,0,3,_,_,_] After count (5 in this case), the rest of the nums are ignored. This is a simple solution, the idea is to have two indexes. […]