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 a4c4623 commit 089c75eCopy full SHA for 089c75e
lesson_07/conditionals/src/lesson7.ts
@@ -11,9 +11,15 @@ export function compareStrings(a: string, b: string): number {
11
// The distance will be a number less than 0 if string `a` is lexicographically less than `b`, 1
12
// if it is greater, and 0 if the strings are equal.
13
const distance = computeLexicographicDistance(a, b);
14
-
15
- // TODO(you): Finish this method.
16
+ if (distance < 0){
+ return -1;
+ }
17
+ if (distance > 0) {
18
+ return 1;
19
20
+ if (distance === 0) {
21
22
23
return 0;
24
}
25
0 commit comments