Skip to content

Commit

Permalink
remove some using coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher committed Mar 24, 2024
1 parent 2ba6f4f commit b7551c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Src/Problem1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def myLast (l : List α) : Option α :=
-- sorry
match l with
| [] => none
| [a] => some a
| [a] => a
| _ :: as => myLast as
-- sorry

Expand Down
2 changes: 1 addition & 1 deletion Src/Problem2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def myButLast (l : List α) : Option α :=
else
let i := l.length - 2;
match l[i]? with
| some x => some x
| some x => x
| none => none
-- sorry

Expand Down
2 changes: 1 addition & 1 deletion Src/Problem3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def elementAt (l : List α) (k : Nat) : Option α :=
match l, k with
| [], _ => none
| _, 0 => none
| a :: _, 1 => some a
| a :: _, 1 => a
| _ :: a, k + 1 => elementAt a k
-- sorry

Expand Down

0 comments on commit b7551c0

Please sign in to comment.