public void NullArray_Success() { int[] arr = null; var sol = new ContainDuplicates(arr); var result = sol.GetContainDuplicatesWithHash(); Assert.False(result); }
public void ManyItemsArray_Success_True() { int[] arr = { 1, 1, 1, 3, 3, 4, 3, 2, 4, 2 }; var sol = new ContainDuplicates(arr); var result = sol.GetContainDuplicatesWithHash(); Assert.True(result); }
public void FourthItemsArray_Success_True() { int[] arr = { 1, 2, 3, 1 }; var sol = new ContainDuplicates(arr); var result = sol.GetContainDuplicatesWithHash(); Assert.True(result); }
public void UniqueItemsArray_Success_False() { int[] arr = { 1, 2, 3, 4 }; var sol = new ContainDuplicates(arr); var result = sol.GetContainDuplicatesWithHash(); Assert.False(result); }
public bool ContainsDuplicate(int[] nums) { var sol = new ContainDuplicates(nums); return(sol.GetContainDuplicatesWithHash()); }