tracks-on-tracks-on-tracks v2

This commit is contained in:
Alexander Heldt
2025-11-03 21:49:10 +01:00
parent b8181175c9
commit 0df72539ef

View File

@@ -24,13 +24,9 @@ pub fn exciting_list(languages: List(String)) -> Bool {
// - The first on the list is Gleam. // - The first on the list is Gleam.
// - The second item on the list is Gleam and the list contain either two or three languages. // - The second item on the list is Gleam and the list contain either two or three languages.
case languages { case languages {
[first] -> first == "Gleam" ["Gleam", ..] -> True
[first, second, ..] -> [_, "Gleam"] -> True
first == "Gleam" [_, "Gleam", _] -> True
|| {
second == "Gleam"
&& { list.length(languages) == 2 || list.length(languages) == 3 }
}
_ -> False _ -> False
} }
} }