Ad
  • Custom User Avatar

    BigInt cannot be a common approach if a language does not support it.
    Once again, this kata was meant for languages which do not support big integer arithmetic, either natively, or by easily accessible libraries. JS translation was created when bigint was not in the language, and now it's considered undesired and it's planned for removal. Languages like C, C++, COBOL, are valid languages for this task. Languages like Java or C# are arguably misused: BigInteger classes can be restricted, but still the question would be whether this is reasonable, and can be done reliably enough. If the answer would be "no", the translations should be disabled too.

    Currently, Codewars does not support any form of disabling translations, so we have to live with whatever got carelessly approved or did not age well. But such functionality is planned, and JS translation will be probably first to be removed from bigint kata, with possibly other languages which natively support bigint to follow.

  • Custom User Avatar

    It's also worth noting that BigInt would and should be the common approach to a problem like this, and that this kata still teaches newer programmers like myself this staple data type. A solution that doesn't use big int might be better suited to a task that isn't addition for the sake of exploring large integer handling without worrying about addition on top of it.

  • Custom User Avatar

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

  • Default User Avatar

    That's understandable. However, BigInt has been widely supported for quite a while now, so the instructions for the Kata should probably be updated to explicitly state that BigInt is to be avoided in any solutions attempted.

  • Custom User Avatar

    Yes, the reason is when the kata was published, BigInt was not available in NodeJS. Feel free to propose a better description (click fork at top page if you solved the kata, then submit your changes for approval on Discourse page).

  • Custom User Avatar

    That should be explicitly stated.

  • Custom User Avatar

    for cpp at least is for sure 4kyu

  • Custom User Avatar

    Kyus of approved katas cannot be changed, it's useless to complain about that.

  • Custom User Avatar

    The point of this kata is not to use BigInt.

  • Custom User Avatar

    There's no issue, the instructions are worded oddly. Make sure you're representing the population with the correct data type

  • Custom User Avatar
  • Custom User Avatar

    because I'm not very good at JS XD. If you are interested, I've changed this.

  • Custom User Avatar

    And what's the suggestion? The instructions are clear.