Asymptomatic O(1) || Constant Time Solution || using static
\nclass Solution {\n    static final int N = 100001, mod = 1000000007;\n    static int res[];\n    Solution(){\n        if(res==null){\n            res=new int[
```\nclass Solution {\n    static final int N = 100001, mod = 1000000007;\n    static int res[];\n    Solution(){\n        if(res==null){\n            res=new int[N];\n            for(int i=1,n=0,pow=1;i<N;i++){\n                if(i==pow){\n                    pow<<=1;\n                    n++;\n                }\n                res[i]=(int)((((long)res[i-1]<<n)|i)%mod);\n            }\n        }\n    }\n    public int concatenatedBinary(int n) {\n        return res[n];\n    }\n}\n```
['Java']