So it's work on my laptop, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407] memory 248 kB time = 23 ms [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 6688, 8208, 9474, 33286, 54748, 91818, 91819, 92727, 93084, 117651, 548834] memory 379 kB time = 858 ms but still show me that is too long, and colapse Validation it's no perfect code