C# accepted solution


  • 0
    T
    public class Solution {
        public IList<int> FindDisappearedNumbers(int[] nums) {
            var list = new int[nums.Length];
            
            for(var i =0; i < nums.Length; i++){
                list[nums[i] - 1]++;
            }
            
            return list.Select((v,i) => new {v, i}).Where(a => a.v == 0).Select(b => b.i + 1).ToList();
        }
    }
    

Log in to reply
 

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