Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

longest common substring between 2 string #258

Open
iamsunil25 opened this issue Oct 5, 2021 · 7 comments
Open

longest common substring between 2 string #258

iamsunil25 opened this issue Oct 5, 2021 · 7 comments
Labels
appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 3 30 Points Question Add a question

Comments

@iamsunil25
Copy link
Contributor

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

@iamsunil25
Copy link
Contributor Author

@SarthakKeshari assign me this issue.

@SarthakKeshari
Copy link
Owner

@iamsunil25,
I wish to reform this question and will put it under admin-choice

@iamsunil25
Copy link
Contributor Author

@iamsunil25, I wish to reform this question and will put it under admin-choice

okk

@SarthakKeshari
Copy link
Owner

SarthakKeshari commented Oct 5, 2021

@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.

@SarthakKeshari
Copy link
Owner

@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

@SarthakKeshari SarthakKeshari added appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 3 30 Points Question Add a question labels Oct 5, 2021
@SarthakKeshari
Copy link
Owner

@iamsunil25,
Kindly add your solution to "String Handling" folder.
Also mention "(admin-choice)" word in your filename and PR title.
Deadline - 06/10/2021

@GayatriChaudhari1281
Copy link
Contributor

Please assign this issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 3 30 Points Question Add a question
Projects
None yet
Development

No branches or pull requests

3 participants