Prata- Spoj question explained by Prateek Bhaiya

I have submitted the code with the same logic, what bhaiya taught in the tutorial video of Prata.


here’s my code.
Please tell me what wrong I’m doing.

@adarsh_2001 hey your code is not visible . share your code through coding blocks ide


This code is giving Time Limit Exceeded. Can you help as to why? and what insights I’m missing.

@adarsh_2001 hey this your updated code you are using two different variables for storing ans i.e one is the ans variable and the other one is the years variable.

@himanshu_aswal Thank you.

1 Like