I am getting 2 warnings in all my code

runguard: warning: timelimit exceeded (wall time): aborting command
runguard: warning: command terminated with signal 15

these are the 2 warnings i am getting in all my codes how can i fix it.

Hi Ayushi can you tell me why have you used bfs after the lca. I see that your lca is correct. I recommend you to see your build tree and bfs . It is possible you’re doing redundant things.

sir i have defined my lca function after bfs

I meant the calling. You are calling lca first then bfs. Can you send me the question’s link.

its lowest common ancenstor

https://ide.codingblocks.com/s/347424 This I have changed there was a slight error in the lca function.

okay thankyou i got it.