leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0268.cpp (208B)


      1 class Solution {
      2   public:
      3     int missingNumber(vector<int> &nums) {
      4         int res = nums.size();
      5         for (int i = 0; i < nums.size(); i++)
      6             res ^= i ^ nums[i];
      7         return res;
      8     }
      9 };