How??? Because when I calculate by using brute force and above algorithm all test case give same answers.
Is output of {1,2} in your code 9 ?? As given in this post itself ?
Single 2 means the array size is 1 only ??
Nope 2 meaning all elements from 1 to 2
Nope because my program take pairs a(I), a(j) where I<j
1 Like
I had posted the divisor sieve for the CountAll question.
Not really , this was my first good Bit Manipulation question as well.
1 Like