My code is not passing all the testcases can you tell wich testcases it fails?

hello @akash_281
image

check value of n .
it is upto 10^6.
and because ur algorithm has time complexity - O(n^2)
it will not pass.
try to think of O(n) approach.