Skip to content

Instantly share code, notes, and snippets.

View nagamanichowdary's full-sized avatar

nagamanichowdary

View GitHub Profile
public class StringSimilarity {
public static int calculate(String s){
char[]arr=s.toCharArray();
int length=arr.length;
int count=length;
for(int i=1;i<length;i++){
int len=length-i;
int j=0;
for(;j<len;j++)
if(arr[j]!=arr[j+i]){