Last active
September 29, 2017 13:49
-
-
Save kingori/1c5677c83406058280a748039673c942 to your computer and use it in GitHub Desktop.
This file contains 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
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