[JAVA] Clean O(n) Solution
\tclass Solution {\n\t\tpublic int concatenatedBinary(int n) {\n\t\t\tlong size = 0, result = 0;\n\n\t\t\tint ma = (int)1e9+7;\n\n\t\t\tfor(int i = 1;i<=n;i++) 
\tclass Solution {\n\t\tpublic int concatenatedBinary(int n) {\n\t\t\tlong size = 0, result = 0;\n\n\t\t\tint ma = (int)1e9+7;\n\n\t\t\tfor(int i = 1;i<=n;i++) {\n\t\t\t\tif((i&(i-1)) == 0) size++;\n\n\t\t\t\tresult = ((result << size) | i)%ma;\n\t\t\t}\n\t\t\treturn (int)result;\n\t\t}\n\t}
[]