You are viewing a single comment's thread. Return to all comments →
I get 'Time limit exceeded ' error. This code is 62.96 points. How can I edit this code?(test case 6, 7, 10 and 11)
public static int stringSimilarity(string s) { char[] arr = s.ToCharArray(); int result = arr.Length; for (int i = 1; i < arr.Length; i++) { int sum = 0; for (int j = i; j < arr.Length; j++) { if (arr[j] != arr[j - i]) break; sum++; } result += sum; } return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
String Similarity
You are viewing a single comment's thread. Return to all comments →
I get 'Time limit exceeded ' error. This code is 62.96 points. How can I edit this code?(test case 6, 7, 10 and 11)