As well as range checks with chars
# advent-of-code
a
As well as range checks with chars
💯 2
d
how did you range check the hair color (it was # followed by 6 hex chars)?
oh || - duh
a
Copy code
found["hcl"]!!.substring(found["hcl"]!!.length - 6).all { it in '0'..'9' || it in 'a'..'f' }
yep! haha
excuse the
found["hcl"]!!.length - 6
, legit thought # meant an arbitrary number at first, not an actual hashtag
d
oh I need to remember the
.all
- nice
that was your alternative to
when
?
a
all and any are such useful functions!
yep 😂
👍 1