Ad
  • Custom User Avatar

    time squaresums.sh 60000000 -> 1, 9, 99, 10954, 59999999 == real 0m0.027s
    actually solvable in under 90 mins using a shell script thats about 50x 'better' than 12s.
    dudes...

  • Custom User Avatar

    why would that make a diff, absolute size is meaningless. its about the geom of the input.
    time squaresums.sh 100000 -> 1, 2, 4, 13, 447, 99999 == real 0m0.028s
    time squaresums.sh 1000000000000 -> 5, 22, 1261, 1414213, 999999999999 == real 0m0.023s

  • Custom User Avatar

    this result is from my shell-script.
    its not hard to beat when you're not being so literal. :)

    time primegap 42 1000000 1001000
    1000039 1000081

    real 0m0.009s
    user 0m0.008s
    sys 0m0.000s

    time primegap 2 10000000 10001000
    10000139 10000141

    real 0m0.012s
    user 0m0.008s
    sys 0m0.004s

  • Custom User Avatar

    wow. immediately disliked 7 of the 10 other shell solutions. :)

  • Custom User Avatar

    great puzzle, lmao, only realized what the quesion was after solving the general problem.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    dismissed sed and hammered out/nailed the array solution before i knew sensei thought they were hard :)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    hahahaha! its my 2nd day here and i thought that doing a bash kata
    meant that i had to restrict my self to bash! hahahaha. great joke sensei!

    next up generating .elfs via echo -e!