We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0b94664 + dec15bc commit e7c0b94Copy full SHA for e7c0b94
1 file changed
exams/cheap-flights/index.md
@@ -78,7 +78,7 @@ partial solutions to extend the cheapest path.
78
In Scheme you can `sort` a list with the help of a predicate function taking two arguments. In case
79
of a list of lists (containing cost and path) you could do the following:
80
```racket
81
-> (define (cheaper? x y) (< (car x) (car y)))
+> (define (cheaper? x y) (< (cadr x) (cadr y)))
82
> (sort '(((2 3) 2.0) ((2 1 3) 1.5)) cheaper?)
83
'(((2 1 3) 1.5) ((2 3) 2.0))
84
```
0 commit comments