Skip to content

Commit 089c75e

Browse files
feat: adds Karens lesson_07
1 parent a4c4623 commit 089c75e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ export function compareStrings(a: string, b: string): number {
1111
// The distance will be a number less than 0 if string `a` is lexicographically less than `b`, 1
1212
// if it is greater, and 0 if the strings are equal.
1313
const distance = computeLexicographicDistance(a, b);
14-
15-
// TODO(you): Finish this method.
16-
14+
if (distance < 0){
15+
return -1;
16+
}
17+
if (distance > 0) {
18+
return 1;
19+
}
20+
if (distance === 0) {
21+
return 1;
22+
}
1723
return 0;
1824
}
1925

0 commit comments

Comments
 (0)