Skip to content

Commit

Permalink
Tutorial2 readme : init diff with -1 as documented
Browse files Browse the repository at this point in the history
The instructions mention using -1 as a sentinel but the example given initializes with "1" instead.
  • Loading branch information
cycle23 authored Oct 13, 2016
1 parent f577573 commit 5f130e5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ First, eliminate processing of empty lists with a pattern match. Any `List` not
The maximum difference of a single-element `List` will be sentinel value `-1`:

```
list.foldLeft((???,???, 1 )) {(???, ???) => ???}
list.foldLeft((???,???, -1 )) {(???, ???) => ???}
```

Plug into the pattern match. Extract the maximum difference from the 3-tuple -- it is all we need.
Expand Down

0 comments on commit 5f130e5

Please sign in to comment.