Skip to content

Instantly share code, notes, and snippets.

@kingori
Last active September 29, 2017 13:49
Show Gist options
  • Save kingori/1c5677c83406058280a748039673c942 to your computer and use it in GitHub Desktop.
Save kingori/1c5677c83406058280a748039673c942 to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
fun getMap(arg1: Array<Int>, arg2: Array<Int>) =
arg1.mapIndexed { index, v -> (v or arg2[index]).toString(2) }
.map {
it.map { if (it == '1') '#' else ' ' }
.toCharArray().joinToString(prefix = "\"", postfix = "\"", separator = "")
}
println(getMap(arrayOf(9, 20, 28, 18, 11), arrayOf(30, 1, 21, 17, 28)))
println(getMap(arrayOf(46, 33, 33, 22, 31, 50), arrayOf(27, 56, 19, 14, 14, 10)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment