public class Solution {
public bool ContainsDuplicate(int[] nums) {
var list = nums.Distinct();
if (list.Count() == nums.Length)
{
return false;
}
else
{
return true;
}
}
}
https://leetcode.com/problems/contains-duplicate/#/description
public class Solution {
public bool ContainsDuplicate(int[] nums) {
var list = nums.Distinct();
if (list.Count() == nums.Length)
{
return false;
}
else
{
return true;
}
}
}
https://leetcode.com/problems/contains-duplicate/#/description