What would be the ansers

If we define a magic number between two strings A and B as longest common subsequence of A and B. then what would be the magic number for a pair of string A=”AGGTAB” , B=”GXTXAYB”?

Hey @Vikaspal ,
This question uses LCS algorithm , you must be familiar with the algorithm .
This is one visualization i found that will help you better understand the question

The Link for this site is here : https://www.cs.usfca.edu/~galles/visualization/DPLCS.html
you can play around with it

Happy Coding !