Palindrome Algorithm Efficiency
Which of the following describes the most efficient method for determining if a string is a palindrome?
A
Create all possible substrings and check each one
B
Compare characters from outside-in using indices
C
Sort the characters and compare to original
D
Convert to array, reverse, and compare character by character
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | ac0335840 | 6 | 10 | 4m 36s | 284 |
| #2 | yungmandrr | 2 | 3 | 0m 31s | 159 |
| #3 | jjacobs | 1 | 1 | 0m 12s | 88 |
| #4 | tianbo.shen | 1 | 1 | 0m 15s | 85 |
| #5 | legendarykavin10 | 1 | 2 | 0m 28s | 62 |
| #6 | jdvillalta865 | 1 | 2 | 0m 30s | 60 |
| #7 | soniahalepota2005 | 1 | 2 | 0m 38s | 52 |
| #8 | ballsgaming214 | 2 | 5 | 2m 07s | 43 |
| #9 | afeldman0610 | 1 | 2 | 1m 01s | 29 |
| #10 | ardenashuri | 1 | 2 | 1m 06s | 24 |
Items per page:
10
1 – 10 of 24
APFIVE