葉林
Linked with GitHub
# LeetCode - 0961. N-Repeated Element in Size 2N Array ### 題目網址:https://leetcode.com/problems/n-repeated-element-in-size-2n-array/ ###### tags: `LeetCode` `Easy` ```cpp= /* -LeetCode format- Problem: 961. N-Repeated Element in Size 2N Array Difficulty: Easy by Inversionpeter */ class Solution { public: int repeatedNTimes(vector<int>& A) { bool counts[10000] = {}; for (int &i : A) if (!((counts[i] ^= 1) & 1)) return i; throw NULL; } }; ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up