Skip to content

Instantly share code, notes, and snippets.

@toumorokoshi
Last active October 15, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toumorokoshi/d19d68176e0ef63c255c9aea6475dac9 to your computer and use it in GitHub Desktop.
Save toumorokoshi/d19d68176e0ef63c255c9aea6475dac9 to your computer and use it in GitHub Desktop.
Blog Code Snippets
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