6 kyu

Sum of Two Integers

1,463 of 5,952MrZizoScream
Description
Loading description...
Restricted
  • Please sign in or sign up to leave a comment.
  • 8264016 Avatar

    This felt much harder than it should've, since I had a dumb knowledge gap in not knowing what bitwise operation is, and spent way too much time trying to look for some sort of clever trick lol

  • KaninGleb Avatar

    Thank you for this challenging but enjoyable kata!

  • OlegZorin Avatar

    PHP. I have 'Source code contains invalid string interpolation' error. But can't see any in my code... Is't possible to get detail on error?

  • ReganRyanNZ Avatar

    I'm wondering if this kata should be adjusted.. At least the ruby version, I'm browsing the solutions and not a single one is actually solving the kata, they are all just variations of gaming the system to allow the native '+' function to work.

    I got something working for adding positive numbers, but negatives are much harder. Especially when there's no way to add the "-" to the final result without triggering the "no +/-" rule...

  • Cloud Walker Avatar

    This comment has been hidden.

  • Kawamatsu Avatar

    The kata allows one to simply write return x \u002b b; So one can simply replace + with its unicode Value I am not sure whether this is intended or not

  • My_Apple Avatar

    I write in c ++, the code in Visual Studio works fine, but here it gives an error: "runtime error: execution reached the end of a value-returning function without returning a value". Is it a bug in my code, or is there some flaw in this task??

  • ArtūrsCēsis Avatar

    Pretty easy!

  • spd_souvik Avatar

    This comment has been hidden.

  • Maxmudov Avatar

    it's working but 12 seconds aaaaaaaaaaaaaaa!

  • OmegaAI Avatar

    This comment has been hidden.

  • Shrader Avatar

    Getting this error (FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory) but passing all tests.

  • catarina claes Avatar

    This comment has been hidden.

  • Unnamed Avatar
  • hongchris96 Avatar

    This comment has been hidden.

  • wfdoran Avatar

    In rust, I am getting "solution contains a '-'." failure.

    Is the checker picking up the '-' in

    fn tadd(x: u32, y: u32) -> u32 {

    as a minus sign?

  • anton_of_the_dead Avatar

    This comment has been hidden.

  • Shrader Avatar

    This comment has been hidden.

  • imjasonmiller Avatar
  • rigelbar Avatar

    In julia many random tests are wrong. For example: add(-5284214779925522942, -5478334000412401012) --> 7684195293371627662. And the same for many others.

  • TontonPizza Avatar

    This comment has been hidden.

  • dinglemouse Avatar

    C is giving me error:

    Solution contains a '+'. Tsk-tsk.
    

    But my solution code has no + nor any -

  • a.stulov Avatar

    This comment has been hidden.

  • rubs33 Avatar

    I am getting: "Source code contains invalid string interpolation"

    But I am not using any prohibited function or code construction. :(

    I think you should use token_get_all to look for invalid code constructions instead of strstr :P

  • L1ker Avatar

    Increment and decrement operations are not forbidden, right? Because I get the error saying that I used addition and subtraction probably because of the ++/--

  • lucic71 Avatar

    Nasm: 'Solution contains "add". Tsk-tsk.' even though neither 'add' nor any prohibited instruction was used.

  • nomennescio Avatar

    Please review and approve my Forth translation

  • VicziTomi Avatar

    This comment has been hidden.

  • user2929146 Avatar

    This comment has been hidden.

  • stellartux Avatar
  • VladEvst1824OP Avatar

    I have an error (FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory), when coding in JS. ANy suggestions what should i do to make it pass?

    P.S. All test's cases pass but with this error.

  • vladderb Avatar

    Wrote on c#, and now I first tried c ++. The difference is small, but it was interesting.

  • cliffstamp Avatar

    This comment has been hidden.

  • fatherJS Avatar

    Hi, can anyone tell me how to contribute to the kata, e.g.: correct translations or misspellings?

  • dances-with-peons Avatar

    This comment has been hidden.

  • SashaVosu Avatar

    why when checking lambda expression -> is taken as "-"?

  • ___i Avatar

    This comment has been hidden.

  • Firefly2002 Avatar

    This comment has been hidden.

  • bored69 Avatar

    This is at least the second approved duplicate kata by MrZizoScream...

  • Anastat@ Avatar

    What numbers generate random test? I got java.lang.OutOfMemoryError: Java heap space

  • anter69 Avatar

    If you're looking for a python version, click here: https://www.codewars.com/kata/simple-sum-with-restrictions/

  • Blind4Basics Avatar

    So as I said... two more thing to forbid in Java... ;)

  • Blind4Basics Avatar

    Java: seems like some other things should be forbidden, for now...

  • Unnamed Avatar

    All banned things by language aren't listed anywhere, like require and eval in JS, how should one know they're banned?

  • Voile Avatar

    So who approved this duplicate? No unresolved issues about this does not mean one can just approve a duplicate like nothing.

  • Daniel Ray Avatar

    This comment has been hidden.

  • Unnamed Avatar

    The random tests can generate a pair of numbers with their sum outside of int range.

  • Unnamed Avatar

    The random tests always generate negative numbers.

  • Unihedron Avatar

    Your reference solution for the random tests are too slow. Even though my code works fine, it still won't pass because of it.

    image

  • Unihedron Avatar

    Typo in "Nagtivee": should be negative.

  • Unihedron Avatar
  • Voile Avatar