7 kyu

Incrementer

4,621 of 11,981kkavita92
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • NoneAli Avatar

    This comment has been hidden.

  • AmirTallap Avatar

    This comment has been hidden.

  • mike2r Avatar

    C

    Description says "return an empty array if your array is empty", but tests require null to be returned.

  • unique3052 Avatar

    This comment has been hidden.

  • Unnamed Avatar

    Go, not fixed:

    Expected
        <[]int | len:0, cap:0>: []
    to equal
        <[]int | len:0, cap:0>: nil
    

    emptyArr isn't initialized, so it's nil.

  • Unnamed Avatar

    Go:

    return an empty array if your array is empty

    Expected
        <[]int | len:0, cap:0>: []
    to equal
        <[]int | len:0, cap:0>: nil
    

    (Since nil slices seem to be idiomatic in Go, both probably should be accepted.)

  • akar-0 Avatar

    (author is inactive)

  • user7154500 Avatar

    Excellent kata

  • Femi90 Avatar

    please i cant figure out where my code is wrong on this kata.i need help .

  • KillerTigerMOF Avatar

    I'm looking at the tests and they do not match up with what is expected from the instructions. I have tested locally on my own IDE and have receive the expected results according to the instructions. Please fix so this can be completed properly. I was using the Java language.

  • AbdullahTrees Avatar

    Instructions are a bit inaccurate with regards to what is asked, for example instruction asserts that 'return an empty array', but you actually have to return NULL.

  • walt1010 Avatar

    How does [2,4,3] result in [2,4,6]? I must be misunderstanding the question completely. I wouldd have thought it should result in [3,6,6]]

  • codekook Avatar

    The tests in the python version of this kata do not return accurate results.

  • JohanWiltink Avatar

    Haskell translation with description spelling erorr fixed.

  • hikionori Avatar

    I think the tests are wrong. When verifying that the code is working, the tests do not match the tests in the test function.

  • Madjosz Avatar
  • dfhwze Avatar
  • akar-0 Avatar

    COBOL translation (author inactive).

  • mambrofett Avatar

    Check input on second test for python: [,1 2, 3] would be iterated as [1 2, 3]

  • GlotNataliya Avatar

    In random tests, it throws an error (#<NoMethodError: undefined method `expect' for main:Object Did you mean? exec>), although normal tests pass just fine. What is the reason? Ruby.

  • ejini战神 Avatar
    • Ruby 3.0 should be enabled (Refer this & this for more detail)
  • ejini战神 Avatar
    • Missing return type in TS
  • rcfroggatt786 Avatar

    The Ruby version description is using curly braces for array instead of square brackets.

  • uniapi Avatar
  • Aizaz_Ahmad Avatar

    C++ translation translation added :)

  • jsyoon8000 Avatar

    This comment has been hidden.

  • superanika Avatar

    Hi, I'm trying this kata, but it seems that your tests are wrong with the numbers higher than 10:

    it("Testing for [4, 6, 7, 1, 3]", () => assert.deepEqual(incrementer([4, 6, 7, 1, 3]), [5, 8, 0, 5, 8])); it("Testing for [3, 6, 9, 8, 9]", () => assert.deepEqual(incrementer([3, 6, 9, 8, 9]), [4, 8, 2, 2, 4])); it("Testing for [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 8]", () => assert.deepEqual(incrementer([1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 8]), [2, 4, 6, 8, 0, 2, 4, 6, 8, 9, 0, 1, 2, 2])); });

    the first one should return [5, 8, 10, 5, 8], the second one [4, 8, 12, 12, 14] and so on. Can you fix it so I can complete it?

    Thanks!

  • kevinas Avatar

    This comment has been hidden.

  • user8436785 Avatar
  • FArekkusu Avatar

    each digit incremented by its position in the array

    the first digit will be incremented by 1

    It should be properly mentioned that arrays are 1-based.

  • Blind4Basics Avatar

    JS: why the hell are there a random number of random tests...!?? XD

  • user8436785 Avatar

    CoffeeScript :coffee:, Crystal :gem:, Python, and Dart :dart: translations kumited, please review and approve :smile:

  • sfoulk Avatar

    There appears to be an error in the random tests; here is your random input array:

    [ 3, 9, 5, 7, 6, 2, 2 ]

    then I get this error message:

    Incorrect output - Expected: '[5, 3, 1, 5, 6, 4, 6]', instead got: '[4, 1, 8, 1, 1, 8, 9]' <== my answer

    But it looks like my answer is correct...

  • UHanczar Avatar

    Hi, when I run my code, it passes in all sample tests, but it fails in all random tests. In console I see, that it just doesn't add counter to numbers in array in random test, but, still, it does so in all sample tasts. May be it could be some mistake in random tests? Thank you.

  • RandyLedbetter Avatar

    This comment has been hidden.

  • donaldsebleung Avatar

    Simple and fun Kata but your Description examples are incorrect - they make it appear as if the user function receives a variable number of arguments instead of exactly 1 numerical array.