💡 Place the tiles


not getting right answer please let me know where i am wrong

Hi Vivek,
there were 3 mistakes

  1. ur logic was not fully correct… u would have to recursively check for n-1 and n-2
  2. due to such large contraints declare the array globally.
  3. u were not taking mod as stated in ques.

refer my code https://ide.codingblocks.com/s/628075

one test cases is still failing in your provided code

Hi, for that last test case error is MLE(memory limit exceeded) bcoz of that array size… since logic is same of Fibonacci series only, do it same way…
refer this code https://ide.codingblocks.com/s/628172 it will pass all test cases…

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.