Skip to content

Commit e4f82af

Browse files
committed
add cpp version(use set)
1 parent ab93d30 commit e4f82af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public:
3+
int repeatedNTimes(vector<int>& A) {
4+
for(int i = (A.size() >> 1) - 1; i < A.size(); ++i)
5+
for(int j = i+1; j < A.size(); ++j)
6+
if(A[i] == A[j])
7+
return A[i];
8+
return A[0] ;
9+
}
10+
};

0 commit comments

Comments
 (0)