Why it is giving TLE in last test case?

@abhi542136 i am not able to open the problem please attach ss for problem statement if possible

@abhi542136 your code is perfectly fine but do not use long long everywhere as it take more time only create long long arrays where necessary like dp and values array and the answer variable it will work fine
Coding Blocks IDE
this is the changed code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.