Easy C# Solution Accepted


  • 0

    public class Solution {
    public int RemoveElement(int[] nums, int val) {
    var res = 0;
    for(int i = 0; i< nums.Length; i++)
    {
    if(nums[i] != val)
    nums[res++] = nums[i];
    }
    return res;
    }
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.