Java-Questions-and-Solutions
Java-Questions-and-Solutions copied to clipboard
longest common substring between 2 string
Enter your question -
Q. length of longest common substring between 2 string in java? input = 1. "sunil " 2. "sunita" output= 4 (suni)
Enter link to the question(if question belongs to any online platform) -
NA
Tags for the question(eg - Array, Basic, Stack, etc.) -
String
@SarthakKeshari assign me this issue.
@iamsunil25, I wish to reform this question and will put it under admin-choice
@iamsunil25, I wish to reform this question and will put it under admin-choice
okk
@iamsunil25, I wish to reform this question and will put it under admin-choice
@iamsunil25, I wish to correct myself instead of admin-choice it would be appreciation tag.
@iamsunil25, Updated question
Enter your question -
Q. length of longest common substring between 2 strings permutations in java?
NOTE - Lowercase and Uppercase alphabets will be treated differently Sample Test case 1 Input - cat tackle
Output - 3
Explaination - Permutations of "cat" are - cat, act, tca, cta, atc, tac Permutations of "tackle" are - tackle, atckle, ctakle, tcakle, actkle, catkle, etc.
If we see: 1st permutation of "cat" - cat 6th permutation of "tackle" - catkle We can see longest common substring is "cat" and is of "3" letters
Sample Test case 2 Input - cat taCkle
Output - 2
Explaination - Permutations of "cat" are - cat, act, tca, cta, atc, tac Permutations of "tackle" are - taCkle, atCkle, Ctakle, tCakle, aCtkle, Catkle, etc.
If we see: 1st permutation of "cat" - cat 6th permutation of "tackle" - Catkle We can see longest common substring is "at" and is of "2" letters. Since 'c' and 'C' will be treated differently.
Enter link to the question(if question belongs to any online platform) -
NA
Tags for the question(eg - Array, Basic, Stack, etc.) -
String
@iamsunil25, Kindly add your solution to "String Handling" folder. Also mention "(admin-choice)" word in your filename and PR title. Deadline - 06/10/2021
Please assign this issue to me.