Faster way to generate these numbers?

Revision en1, by m.khooryani, 2015-09-29 19:42:09
        int limit = 1 << n;
        for (int i = 0; i < limit; i++) {
            if (Integer.bitCount(i) >= 3) {
                System.out.println(i);
            }
        }
Tags bitmask

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English m.khooryani 2015-09-29 19:42:09 234 Initial revision (published)