File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 299
299
* [ FormatPhoneNumber] ( String/FormatPhoneNumber.js )
300
300
* [ GenerateGUID] ( String/GenerateGUID.js )
301
301
* [ HammingDistance] ( String/HammingDistance.js )
302
+ * [ IsPalindrome] ( String/IsPalindrome.js )
302
303
* [ KMPPatternSearching] ( String/KMPPatternSearching.js )
303
304
* [ LevenshteinDistance] ( String/LevenshteinDistance.js )
304
305
* [ Lower] ( String/Lower.js )
Original file line number Diff line number Diff line change 10
10
* Big-O Analysis
11
11
* Time Complexity
12
12
- O(N) on average and worst case scenario as input is traversed in linear fashion
13
- - O(N) on best case scenario, even when input has length of 1, because toString() method takes O(N)
13
+ - O(1) on best case scenario if the input already is a string (otherwise toString() method takes O(N))
14
+ and the first & last characters don't match, triggering an early return
14
15
* Space Complexity
15
16
- O(1)
16
17
*/
You can’t perform that action at this time.
0 commit comments