Longest Common Subsequence TLE Python3

link : CodeChef: Practical coding for everyone
I havebeen trying to solve this problem from many days but it seems to struck .
I have tried many approaches to come to a solution that doesn’t give TLE .
I have tried using numpy also , initialising the array in the start but nothing seems to reduce the time.
Can someone tell me a generalised approach to declare a 2d array in python for dynamic programming as I have searched about this extensively but didn’t found anything useful.
any help will be highly apprecuated