Ad
  • Custom User Avatar

    Thank you for explanation. Found out it already, but thanks so much for spent time.

  • Custom User Avatar

    It's because the way you check if a number is a perfect cube or not is unreliable and will give you different results depending on the environment that your code is operating in. You need to find a more reliable way to judge if a number is a perfect cube.

  • Custom User Avatar

    [[400, 132, 424, 424, 67, 7, 149, 170, 19, 278, 163, 85, 289, 354, 184, 70, 281, 452, 182, 287, 74, 225, 123, 300, 299, 268, 116]
    [239, 53, 146, 38, 219, 127, 131, 359, 470, 462, 132, 295, 311, 428, 233, 203, 207, 378, 443, 291, 83, 206, 18, 481, 339, 480, 435]
    [254, 68, 171, 376, 388, 80, 265, 4, 77, 163, 265, 3, 307, 237, 285, 266, 336, 282, 323, 73, 452, 320, 333, 39, 59, 165, 1]
    [216, 197, 137, 344, 354, 395, 373, 320, 484, 39, 417, 294, 454, 86, 113, 11, 163, 89, 487, 461, 136, 64, 335, 456, 130, 174, 460]
    [242, 215, 150, 39, 72, 219, 181, 87, 232, 54, 178, 431, 403, 346, 328, 211, 370, 163, 132, 285, 359, 286, 428, 26, 241, 151, 336]
    [116, 389, 379, 371, 231, 426, 320, 323, 99, 85, 197, 294, 450, 74, 455, 105, 322, 149, 19, 258, 355, 208, 397, 89, 108, 497, 197]
    [138, 119, 223, 155, 366, 410, 11, 353, 186, 488, 339, 347, 60, 6, 79, 404, 138, 204, 55, 367, 448, 143, 381, 451, 173, 123, 12]
    [71, 167, 264, 378, 48, 338, 251, 54, 446, 219, 91, 38, 208, 95, 273, 131, 100, 267, 179, 279, 213, 221, 58, 318, 490, 263, 7]
    [453, 152, 220, 2, 226, 196, 373, 327, 260, 491, 29, 350, 93, 136, 454, 352, 209, 215, 282, 436, 100, 444, 422, 232, 218, 441, 68]
    [497, 385, 490, 313, 247, 292, 471, 96, 1, 371, 254, 250, 93, 380, 284, 385, 364, 143, 237, 97, 205, 27, 288, 269, 133, 245, 207]
    [8, 425, 417, 267, 112, 161, 151, 169, 355, 455, 301, 322, 131, 175, 31, 472, 71, 330, 142, 40, 416, 226, 153, 456, 466, 496, 282]
    [453, 387, 39, 34, 354, 58, 427, 393, 445, 37, 421, 35, 301, 337, 403, 70, 356, 22, 251, 293, 55, 71, 30, 329, 29, 88, 96]
    [424, 368, 294, 434, 414, 338, 20, 87, 117, 193, 159, 316, 283, 303, 237, 362, 206, 222, 130, 432, 4, 357, 435, 95, 16, 380, 117]
    [232, 468, 427, 400, 98, 489, 129, 155, 88, 79, 495, 342, 322, 440, 241, 392, 334, 347, 166, 233, 76, 136, 322, 192, 392, 149, 285]
    [454, 470, 273, 36, 7, 66, 313, 308, 42, 17, 477, 461, 417, 139, 127, 12, 280, 19, 251, 456, 74, 236, 347, 26, 74, 176, 347]
    [60, 13, 171, 254, 16, 322, 203, 465, 94, 314, 330, 3, 168, 82, 253, 248, 323, 425, 363, 70, 450, 456, 287, 11, 111, 411, 62]
    [256, 126, 499, 141, 117, 474, 8, 398, 402, 85, 38, 344, 280, 269, 312, 497, 249, 24, 43, 7, 50, 51, 7, 203, 362, 106, 34]
    [176, 421, 332, 260, 174, 215, 458, 88, 297, 461, 295, 299, 246, 427, 180, 350, 1, 12, 317, 53, 387, 438, 188, 366, 336, 370, 104]
    [484, 471, 214, 140, 290, 213, 430, 272, 209, 312, 388, 473, 67, 27, 191, 152, 177, 333, 124, 78, 432, 320, 125, 272, 255, 264, 286]
    [156, 142, 236, 48, 304, 245, 304, 196, 321, 28, 10, 105, 460, 300, 474, 417, 320, 397, 318, 191, 500, 56, 37, 296, 366, 416, 357]
    [9, 378, 341, 350, 391, 374, 267, 99, 108, 428, 79, 186, 307, 189, 217, 69, 134, 203, 87, 138, 297, 483, 128, 39, 75, 168, 416]
    [111, 263, 444, 444, 366, 427, 50, 7, 362, 138, 90, 200, 491, 301, 94, 336, 105, 315, 456, 7, 356, 342, 290, 377, 191, 463, 313]
    [201, 210, 40, 285, 437, 196, 115, 1, 322, 353, 109, 348, 68, 198, 128, 53, 254, 240, 15, 179, 209, 461, 470, 398, 158, 44, 335]
    [319, 321, 133, 252, 41, 94, 459, 281, 8, 319, 413, 12, 47, 197, 86, 128, 0, 282, 361, 324, 91, 257, 225, 194, 404, 166, 176]
    [131, 211, 298, 143, 180, 113, 9, 225, 361, 496, 351, 79, 61, 387, 162, 0, 7, 1, 185, 430, 5, 330, 151, 279, 423, 80, 268]
    [476, 200, 230, 83, 140, 236, 93, 381, 447, 315, 62, 182, 393, 44, 316, 5, 0, 131, 147, 216, 472, 268, 431, 431, 380, 6, 344]
    [346, 201, 139, 178, 396, 295, 222, 47, 471, 24, 65, 398, 377, 265, 4, 303, 18, 93, 451, 460, 415, 243, 499, 447, 141, 477, 95]
    ]
    4 should equal 7 ------> Result here

    7
    Process finished with exit code 0 -------> PyCh Result

  • Custom User Avatar

    I don't understand... My code have been tested in the PyCh with all test cases and it working correctly, but when I'm runing my code here I have other results in the most of all tests...

  • Custom User Avatar

    Nice kata, well done.

  • Custom User Avatar

    Approved

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    C Translation (author inactive).

  • Custom User Avatar

    It's solvable (just pasted and re-run my solution), with the right method I assume !

  • Custom User Avatar

    impossible to solve in Ruby

  • Custom User Avatar

    My god.... I need to revise my method for finding cubes... Sorry, and thank you :)

  • Custom User Avatar

    729 (9^3) and 216 (6^3) are both cubes. You're supposed to return the number of lucky sevens so 2 is correct.

  • Custom User Avatar

    I've spent a long moment trying to understand, but I can't get it. Is it ok that we are supposed to add all surrounding numbers and check if the result is a cube? That's what I understand from the description and the provided examples, but it does not match with the tests.
    In Python, first test case: there are two sevens, one is surrounded by 72, 229, 355, 73, sum is 729=6^3, ok, the other is surrounded by 169, 3,13,31, sum is 216, and is not a cube. Neither is any sum of combinations of those numbers, or any of them. However we're supposed to return 2. What's the point?

  • Custom User Avatar

    A very clever solution. This helped me understand reduce better.

  • Custom User Avatar

    This one really tested my patience. Nice kata!

  • Loading more items...