|All-time Popular Problems|
|Delete keys in a Linked list|
|Delete Middle of Linked List|
|Max sum in the configuration|
|Given a linked list of 0s, 1s and 2s, sort it.|
|Top View of Binary Tree|
|Linked List Insertion|
|Boundary Traversal of binary tree|
|n'th node from end of linked list|
Given two strings ‘X’ and ‘Y’, find the length of the longest common substring.
Input : X = "GeeksforGeeks", y = "GeeksQuiz" Output : 5 The longest common substring is "Geeks" and is of length 5. Input : X = "abcdxyz", y = "xyzabcd" Output : 4 The longest common substring is "abcd" and is of length 4. Input : X = "zxabcdezy", y = "yzabcdezx" Output : 6 The longest common substring is "abcdez" and is of length 6.
First line of the input contains no of test cases T,the T test cases follow.
Each test case consist of 2 space separated integers A and B denoting the size of string X and Y respectively
The next two lines contains the 2 string X and Y.
For each test case print the length of longest common substring of the two strings .