The complexity should be
sum of O(r^2) log n times (not n times of course) where r is length of number in the matrix in every step. So r varies as (r1, 2r1, 2^2r1, ...) .
We can see that O(r^2) < O(n^2)
Hence we can write the answer
so it gives us the second last option.
For the last option we must do the entire sum which
comes out to be the given ans.
The complexity should be
sum of O(r^2) log n times (not n times of course) where r is length of number in the matrix in every step. So r varies as (r1, 2r1, 2^2r1, ...) .
We can see that O(r^2) < O(n^2)
Hence we can write the answer
so it gives us the second last option.
For the last option we must do the entire sum which
comes out to be the given ans.