Ad
  • Custom User Avatar

    JS and Python now have visualisation of the correct path down the pyramid. 2 out of 3 solvers will now see why 1074 is the correct answer ( and I have some hope that disproportionally many greedy solvers will solve in either of those languages ).

    Closing for now; we can always reopen.

  • Custom User Avatar

    It's a 4kyu kata, the description warns, and it has an appropriate tag. I'm conflicted. How much do you want to spell out brute force won't cut it?

  • Custom User Avatar

    Totally agree man, and well thanks for starting the initiative and giving lead on this one, helped a lot.

  • Custom User Avatar

    I'm also getting a timeout error, cause of the large numbers.

  • Custom User Avatar

    if they have the same weight,ypu have to compare them according string ascii code

  • Custom User Avatar

    I googled basic java stuff bc I forgot a lot of stuff but nothing specifically related to the problem does that count 😂

  • Custom User Avatar

    @VaxiZ: with your reasoning, nothing's wrong with bogosort, which is, to say the least, arguable.

  • Custom User Avatar

    FWIW I have the complete opposite view; I think it's amazing to realise that mathematicians working hundreds of years ago with pen and paper (or even thousands of years ago using sticks in the sand like Euclid) could come up with "algorithms" that are faster than what a decent brute-force programmer can do with a modern computer -- if that isn't motivation to learn more from the "math" katas, I don't know what is!

    Also, nothing wrong with Opel Astras >:(

  • Custom User Avatar

    Try harder. (Or less harder) The solution is easier than it seems.

  • Custom User Avatar

    I don;t think I agree with your analogy, because comparison of a programming task to a car race is IMO not very good. I would have a different one: you hire a contractor to renovate or build you a house. One contractor performed the task and built your house in half a year. Another one finished identical house in 150 years. Would you consider any of them as better?

    Using an efficient, potentially math based approach is just a right way to do the job. Looping a bajillion of times might give the same result, but is so far from feasible it's difficult to even consider it correct.

  • Custom User Avatar

    .

  • Custom User Avatar

    When two numbers have the same "weight", let us class them as if they were strings (alphabetical ordering) and not numbers:
    180 is before 90 since, having the same "weight" (9), it comes before as a string.

    10003 is before 22 as a string

  • Custom User Avatar
  • Custom User Avatar

    Your code not working is not a kata issue (= a bug in the kata). See the documentation: https://docs.codewars.com/training/troubleshooting/