bjonnh
12/14/2020, 4:32 AMbjonnh
12/14/2020, 5:22 AMbjonnh
12/14/2020, 5:23 AMbjonnh
12/14/2020, 5:24 AMadamratzman
12/14/2020, 5:31 AMadamratzman
12/14/2020, 5:31 AMadamratzman
12/14/2020, 5:32 AMbjonnh
12/14/2020, 5:33 AMbjonnh
12/14/2020, 5:33 AMadamratzman
12/14/2020, 5:33 AMbjonnh
12/14/2020, 5:33 AMadamratzman
12/14/2020, 5:33 AMbjonnh
12/14/2020, 5:34 AMadamratzman
12/14/2020, 5:34 AMfun rec(currString: String, currIndex: Int): List<String> {
if (currIndex == addt.lastIndex + 1) return listOf(currString)
return if (currString[currIndex] != 'X') rec(currString, currIndex + 1)
else {
rec(
currString.toMutableList().apply { this[currIndex] = '1' }.joinToString(""),
currIndex + 1
) + rec(
currString.toMutableList().apply { this[currIndex] = '0' }.joinToString(""),
currIndex + 1
)
}
}
bjonnh
12/14/2020, 5:34 AMbjonnh
12/14/2020, 5:34 AMadamratzman
12/14/2020, 5:35 AMbjonnh
12/14/2020, 5:37 AMbjonnh
12/14/2020, 5:37 AMbjonnh
12/14/2020, 5:37 AMNir
12/14/2020, 5:56 AMJakub Gwóźdź
12/14/2020, 7:50 AMJakub Gwóźdź
12/14/2020, 7:53 AMNir
12/14/2020, 2:19 PMNir
12/14/2020, 2:20 PMTimmy
12/14/2020, 3:00 PMNir
12/14/2020, 3:03 PMNir
12/14/2020, 3:03 PMephemient
12/14/2020, 3:52 PMephemient
12/14/2020, 3:53 PMephemient
12/14/2020, 3:54 PMNir
12/14/2020, 3:56 PMephemient
12/14/2020, 3:57 PMephemient
12/14/2020, 3:59 PMstd::popcount
in C++, popCount
in Haskell, ... popcount is the name I know it by in most languages, but for some reason it's .countOneBits()
in KotlinNir
12/14/2020, 4:04 PMephemient
12/14/2020, 4:42 PMephemient
12/14/2020, 4:44 PMephemient
12/14/2020, 4:44 PMNir
12/14/2020, 4:46 PMNir
12/14/2020, 4:46 PMNir
12/14/2020, 4:47 PMNir
12/14/2020, 4:48 PMNir
12/14/2020, 4:48 PMephemient
12/14/2020, 4:49 PMephemient
12/14/2020, 4:49 PMNir
12/14/2020, 4:51 PMbjonnh
12/14/2020, 4:54 PMNir
12/14/2020, 4:55 PMbjonnh
12/14/2020, 4:55 PMNir
12/14/2020, 4:55 PMbjonnh
12/14/2020, 4:55 PMNir
12/14/2020, 4:56 PMbjonnh
12/14/2020, 4:56 PMbjonnh
12/14/2020, 4:56 PMbjonnh
12/14/2020, 4:56 PMJakub Gwóźdź
12/14/2020, 4:56 PMmask=
entry you need to calculate possible floats anyway, so what's the gain here?Nir
12/14/2020, 4:57 PMJakub Gwóźdź
12/14/2020, 4:58 PMNir
12/14/2020, 4:58 PMNir
12/14/2020, 4:58 PMNir
12/14/2020, 4:59 PMNir
12/14/2020, 4:59 PMJakub Gwóźdź
12/14/2020, 5:04 PMTimmy
12/14/2020, 5:07 PMNir
12/14/2020, 5:17 PMbjonnh
12/14/2020, 5:27 PMbjonnh
12/14/2020, 5:27 PMbjonnh
12/14/2020, 5:28 PMNir
12/14/2020, 6:56 PMephemient
12/14/2020, 6:57 PM2.0.pow(index)
just use 1 shl index
ephemient
12/14/2020, 6:58 PMString.toInt(base)
)Nir
12/14/2020, 7:07 PMNir
12/14/2020, 7:08 PMNir
12/14/2020, 7:08 PMephemient
12/14/2020, 7:18 PMNir
12/14/2020, 7:22 PMNir
12/14/2020, 7:22 PMshl
or and
isn't that big of a dealephemient
12/14/2020, 7:23 PMephemient
12/14/2020, 7:25 PM0 until 1 shl n
parses as 0.until(1).shl(n)
which is obvious nonsenseNir
12/14/2020, 7:30 PMNir
12/14/2020, 7:31 PMbjonnh
12/14/2020, 7:39 PMbjonnh
12/14/2020, 7:39 PMbjonnh
12/14/2020, 7:40 PMNir
12/14/2020, 7:44 PMNir
12/14/2020, 7:45 PMNir
12/14/2020, 7:47 PMbjonnh
12/14/2020, 7:52 PMNir
12/14/2020, 7:55 PMtodd.ginsberg
12/14/2020, 9:23 PMbjonnh
12/14/2020, 10:01 PMbjonnh
12/14/2020, 10:02 PMbjonnh
12/14/2020, 10:02 PM