Last active
October 15, 2018 16:23
-
-
Save toumorokoshi/d19d68176e0ef63c255c9aea6475dac9 to your computer and use it in GitHub Desktop.
Blog Code Snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let n (Int (read-line)) | |
for-range i 0 n | |
let s (Int (read-line)) | |
let possible-engines {} | |
for-range j 0 s | |
let e (read-line) | |
add possible-engines e true | |
let q (Int (read-line)) | |
let switches 0 | |
let seen-engines {} | |
for-range j 0 q | |
let e (read-line) | |
add seen-engines e true | |
if (eq (count seen-engines) (count possible-engines)) | |
let seen-engines {e: true,} | |
++ switches | |
print "Case #" | |
print (+ i 1) | |
print ": " | |
println switches | |
// here's a map | |
let x { | |
true: "foo", | |
false: "bar", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment