code: https://ide.codingblocks.com/s/425674
problem: https://hack.codingblocks.com/app/contests/2022/591/problem
not passing all tc
code: https://ide.codingblocks.com/s/425674
problem: https://hack.codingblocks.com/app/contests/2022/591/problem
not passing all tc
You forgot to take mod with 10^9+7.
it is still failing
Take mod after line 25, just after updating the value in the array.
did it still not working, also please explain the reason
This is how it will be done.
ohh okay got it I was not taking mod when it was being stored
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.