1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-09-19 17:56:55 +02:00

chore: fix formatting

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-09-09 18:56:13 +02:00
parent d7f8f4fd7b
commit e3888415f7
Signed by: mfocko
GPG key ID: 7C47D46246790496
5 changed files with 17 additions and 20 deletions

View file

@ -14,14 +14,11 @@ impl Reachable {
let reaches_pacific = y == 0 || x == 0;
let reaches_atlantic = y == max_y - 1 || x == max_x - 1;
if reaches_atlantic && reaches_pacific {
Reachable::Both
} else if reaches_atlantic {
Reachable::Atlantic
} else if reaches_pacific {
Reachable::Pacific
} else {
Reachable::None
match (reaches_pacific, reaches_atlantic) {
(true, true) => Reachable::Both,
(true, _) => Reachable::Pacific,
(_, true) => Reachable::Atlantic,
(_, _) => Reachable::None,
}
}
}