int removeElement(int* nums, int numsSize, int val){
int left=0;
while(left < numsSize)
{
if (nums[left] == val && nums[numsSize-1] != val) nums[left++] = nums[numsSize---1];
if (nums[left] != val) left++;
if (nums[numsSize-1] == val) numsSize--;
}
return numsSize;
}