paranid5

5 08.11

Nov 7th, 2021 (edited)
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.45 KB | None | 0 0
  1. private infix fun Boolean.arrow(other: Boolean) = !(this && !other)
  2.  
  3. fun main() = generateSequence(1) { it + 1 }.first { len ->
  4.     (1..9).map { "$it".repeat(len) }
  5.         .firstOrNull { x ->
  6.             (x.fold(1L) { acc, c -> acc * c.toString().toInt() }
  7.                 .toString(2) + "00")
  8.                 .toBigInteger(2).toString() == "864"
  9.         }
  10.         ?.let {
  11.             println(it)
  12.             true
  13.         } ?: false
  14. }.let { }
Add Comment
Please, Sign In to add comment