Given an array and a value ,remove all instances of that value in place and return the new length
code Example:
/// <summary>
/// Remove Element from an array
/// </summary>
/// <param name="nums"></param>
/// <param name="target"></param>
/// <returns></returns>
static int RemoveElement(int [] nums,int target)
{
int index = 0;
for(var i = 0; i < nums.Length; i++)
{
if (nums[i] != target)
{
nums[index++] = nums[i];
}
}
return index;
}