Sir, where am i doing mistake ? Please help me to find that

why you are using 2d dp here?
you can also solve it using 1d dp only

reference Code