We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c37bd5 commit 52cc0b0Copy full SHA for 52cc0b0
lesson_07/conditionals/src/lesson7.ts
@@ -25,9 +25,9 @@ export function compareStrings(a: string, b: string): number {
25
// The distance will be a number less than 0 if string `a` is lexicographically less than `b`, 1
26
// if it is greater, and 0 if the strings are equal.
27
const distance = computeLexicographicDistance(a, b);
28
- if (a < b) {
+ if (distance < 0) {
29
return -1;
30
- } else if (a > b) {
+ } else if (distance > 0) {
31
return 1;
32
} else {
33
return 0;
0 commit comments