Ad
  • Default User Avatar

    It's hard to tell from the error message, but I can see in your code it will result in an unwanted trailing whitespace.

  • Custom User Avatar

    This is an issue with this kata.

    It doesn't support anonymous functions. Try and use the function cleanString () {} notation instead.

  • Default User Avatar

    .

  • Custom User Avatar

    If you still have troubles, try looking what the bounds are of the numbers that should be exponentiated

  • Default User Avatar

    Usually, we one can't solve a kata, he tends to think that the kata is the problem. But we should just get better, it's normal to not be able to solve all of them.

  • Default User Avatar

    Description modified. No offense to anybody and no arrogance but I could not have imagined that one try coding without a bit of mathematical vocabulary knowledge and/or research.

  • Custom User Avatar

    @wilsonteh

    I'm glad you had figured it out.

    The problem persists because users move on after figuring out by reading the comments. The description should be updated so that users don't need to.

    I am sorry if I've disrespect @g964. I am just frustrated at how the same user always come out with poor description.

    The first post had nothing constructive in it, so please avoid posting comments like that. That's all.

    I agree that many kata needs improvements. Just keep in mind that kata are maintained by normal users like yourself and you can help to make them better.

  • Custom User Avatar

    @wilsontech

    Please try to be more respectful to other users.

    Asking for clarification and suggesting improvements are better ways to fix the problem.

    @g964

    For "Couldn't understand the first sentence itself."

    Maybe some are having trouble understanding what "successive powers of 10" means.

    Adding something like the following will probably help:

    ```math
    \begin{aligned}
    10^0 &\equiv{1}  &{\pmod{13}}\\
    10^1 &\equiv{10} &{\pmod{13}}\\
    10^2 &\equiv{9}  &{\pmod{13}}\\
    10^3 &\equiv{12} &{\pmod{13}}\\
    10^4 &\equiv{3}  &{\pmod{13}}\\
    10^5 &\equiv{4}  &{\pmod{13}}\\
    \end{aligned}
    ```
    

    Multiply the right most digit of the number with the left most number in the sequence shown above, the second right most digit to the second left most digit of the number in the sequence. The cycle goes on and you sum all these products. Repeat this process until the sequence of sums is stationary.

    ...........................................................................

    Example: What is the remainder when 1234567 is divided by 13?

    7×1 + 6×10 + 5×9 + 4×12 + 3×3 + 2×4 + 1×1 = 178

    I can see how this is confusing, but it's difficult to word it. Maybe just present it better?

      7      6     5      4     3     2     1  (from the right most digit)
      ×      ×     ×      ×     ×     ×     ×
      1     10     9     12     3     4     1  (the repeating sequence)
    
    7×1 + 6×10 + 5×9 + 4×12 + 3×3 + 2×4 + 1×1 = 178
    

    By the way,

    ...........................................................................

    is distracting so I'd suggest removing it.

  • Default User Avatar

    From Wikipedia:
    "A divisibility rule is a shorthand way of determining whether a given integer is divisible by a fixed divisor without performing the division, usually by examining its digits."
    This kata gives a mean to know if a number is or is not divisible by 13.
    You can read:
    https://en.wikipedia.org/wiki/Divisibility_rule#Divisibility_by_13
    to see if you have a better understanding.

    By the way you don't need to be scornful or insulting when you post even if I can understand your repeated frustation with my kata (if you don't appreciate them, please don't take them). Beside that if you want to mark your post as an issue you should be more explicit by pointing what you don't understand so people can answer with precision.

  • Custom User Avatar

    Can you point what exactly you didn't understood from the description?

  • Custom User Avatar

    Read solo-leveling's or Psychemaster's post below. They explain what that means with more detail.

  • Default User Avatar

    Understanding a description is unfortunately part of the job. 35044 people passed the kata so it is understandable with a bit of an effort. Could you tell exactly what you don't understand and I will try to help you?

  • Custom User Avatar

    Great, now I can work with this :D Your code is fine except for one important detail you oversaw. Think about how you remove the processed arr elements and visualize your algorithm on this example: [-3, 15, 8, -1, 7, -1] ^^ I think you will get this in no time. edit: let me know if you figured this out, I really want you to get something out of this kata!

  • Custom User Avatar

    Again, the error message you provided is far to vague, I don't know what's wrong. Post your code (with spoiler flag), so we can look into this.

  • Custom User Avatar

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

  • Loading more items...