leetcode

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

0371.cpp (202B)


      1 class Solution {
      2   public:
      3     int getSum(int a, int b) {
      4         unsigned c;
      5         while (b) {
      6             c = a & b;
      7             a ^= b;
      8             b = c << 1;
      9         }
     10         return a;
     11     }
     12 };