Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Contains Duplicate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Solution {
public boolean containsDuplicate(int[] nums) {
Arrays.sort(nums);
int n = nums.length;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n - 1; j++) {
if (nums[i] == nums[j])
return true;
}
}
return false;
}
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Below are the instructions for this assignment. Your repository should automatic

### 📝 TODO: Complete this section

* **Your name and PID**:
* **Your name and PID**: Zekun Li, zekunli

* **Your partner's name and PID:**
* **Your partner's name and PID:** Trevor Jarzynka, trevorj04@vt.edu

* **Link to selected coding challenge:**
* **Link to selected coding challenge:**: https://leetcode.com/problems/contains-duplicate/

* **Summary of partner's interview feedback:**
* **Summary of partner's interview feedback:**: Good job on completing the problem on time