Skip to content

Commit 2bec56e

Browse files
authored
Update LongestCommonPrefix.java
1 parent 5c9147b commit 2bec56e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Algorithms/Strings/longestCommonPrefix/LongestCommonPrefix.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public static String longestCommonPrefix(String[] strings) {
4444
}
4545
/*
4646
* Complexity Analysis
47-
* Time Complexity: O(S), where S is the sum of all characters in all strings. The algorithm compares the string S1S1 with the other strings [S2...Sn]. There are SS character comparisons, where SS is the sum of all characters in the input array
47+
* Time Complexity: O(S), where S is the sum of all characters in all strings. The algorithm compares the string S1S1 with the other strings [S2...Sn].
48+
* There are S character comparisons, where S is the sum of all characters in the input array
4849
* Space Complexity: O(1)
4950
* */
5051
}

0 commit comments

Comments
 (0)