Time limit exceeded

I exactly did the approach by which Prateek bhaiya taught in unique numbers II video. Even the code is same but it saying time limit exceeded.

hello @ayusdas2000
pls save ur code here -> https://ide.codingblocks.com/
and share link with me

here is the code. https://ide.codingblocks.com/s/241307

pls submit again,it is working fine.
image

when i am compiling it is saying timelimit exceeded but when i am submitting it is saying test case passed.
Why it so?

there might be some issue with compiler