// Solution: Combination
// Try all combinations: O(2^n * (r + n))
// Space complexity: O(n)
class Solution {
    public int maximumRequests(int n, int[][] requests) {
        final int r = requests.length;
        int[] nets = new int[n];
        int ans = 0;
        for (int s = 0; s < (1 << r); ++s) {
            Arrays.fill(nets, 0);
            for (int j = 0; j < r; ++j) 
                if ((s & (1 << j)) != 0) {
                    --nets[requests[j][0]];
                    ++nets[requests[j][1]];
                }
            if (check(nets))
                ans = Math.max(ans, Integer.bitCount(s)); // 记住Java对应的C++的__builtin_popcount为Integer.bitCount！！！
        }
        return ans;
    }
    private boolean check(int[] nets) {
        for (int i = 0; i < nets.length; ++i)
            if (nets[i] != 0) return false;
        return true;
    }
}

@@ -762,36 +762,57 @@
 int 
-i = 0; i %3C nets.length; ++i)
+e : nets) // %E5%BD%93nets%E6%95%B0%E7%BB%84%E4%B8%BA%E7%A9%BA%E6%97%B6%EF%BC%8C%E4%B8%8D%E4%BC%9A%E8%BF%9B%E5%85%A5%E5%BE%AA%E7%8E%AF%EF%BC%8C%E6%89%80%E4%BB%A5%E4%B8%8D%E7%94%A8%E6%8B%85%E5%BF%83nets%E6%95%B0%E7%BB%84%E4%B8%BA%E7%A9%BA%E7%9A%84%E6%83%85%E5%86%B5%E3%80%82
 %0A   
@@ -826,17 +826,10 @@
   if
- (nets%5Bi%5D
+(e
  != 

add MaximumNumberofAchievableTransferRequests.java