Sample input correct but not being accepted
Your Mistakes
-
initialize dp array in every testcase
otherwise previous testcase ans mix with next one -
use long long int instead of int
Modified Code
Your Mistakes
initialize dp array in every testcase
otherwise previous testcase ans mix with next one
use long long int instead of int
Modified Code