Ad
  • Custom User Avatar

    You are right, just my solution is not correct.
    9534330 bigger than 9534303.
    Sorry I have not understood task

  • Default User Avatar

    I don't know what that means. Have you read the description?

    arrange them such that they form the biggest number

    when you say "why", are you suggesting there's an order that forms a higher number? if so, what order is that?

  • Custom User Avatar

    Thanks for the answer; I mean why would 3 be first than 30?

  • Default User Avatar

    you're not asked to sort the numbers if that's what you mean. that seems to be what you're saying.

  • Custom User Avatar

    hi,
    Can anyone explain why in this case
    [3, 30, 34, 5, 9] --> "9534330"
    3 bigger than 30?
    thanks for the help

  • Custom User Avatar

    Also, your code fails for cases like

    [ [ -3, -9, 8, 7, -9, 7, 4, 7, 1 ],
      [Function: trueIfValueEqualsIndex] ]
    

    Because your founded will store 7, but you output the 1st occurence or index (position) of that value, in which the correct result should be 7 (index) instead of 3 (first occurence of the value 7)

  • Custom User Avatar

    In this case : solution([2,2,2], [?,2]) // what result should I get ?
    Thanks

  • Custom User Avatar

    Hi, thanks for you Kata.

    Could clarify,
    how to compute inflation rate ?
    CPIs endDate - CPIs startDate ?
    How does 38.85 appear in your solution?
    Thanks

  • Custom User Avatar

    thank you for your response. I have solved this Kata.
    Could be better if you add to this Kata "If n is greater than the length of values, you should return the sum of the whole array. "

  • Custom User Avatar

    If n is greater than the length of values, you should return the sum of the whole array. That's not what you are doing there :

    if(n > values.length){
            return values.length
          }
    
  • Custom User Avatar

    Hi, can you help me ?
    "maximumSum with n>values.length not working as expected"

    var values = [5, 4, 3, 2, 1];
    console.log( maximumSum(values, 7)) // 7 > 5 return 5

    What is problem ?

  • Custom User Avatar

    thank you for your help

  • Custom User Avatar
                                        vv
    expected '65 119esi 111dl 111lw 108devi 105n 97n 111ka' 
    to equal '65 119esi 111dl 111lw 108dvei 105n 97n 111ka'
                                        ^^ 
    

    There

  • Custom User Avatar

    Sorry, I'm some confused. I have got this result.
    I don't understand what difference between two string
    expected '65 119esi 111dl 111lw 108devi 105n 97n 111ka' to equal '65 119esi 111dl 111lw 108dvei 105n 97n 111ka'
    Can you help me?

  • Default User Avatar

    I haven't yet unlocked this kata so I can't see test cases, but thinking logically:

    this example is using a function called trueIfLengthEqualsIndex - in other words it will return True if the element in the array has the same length as its index.

    Working through the example array given - write down the length of each element and its index:

    The input array ["one","two","three","four","five","six"]

    therefore gives - where e.g. len("three")=5 :

    [ index 0 len=3, index 1 len=3, index 2 len=5, index 3 len=4, >>>> index 4 len=4 <<<< , index 5 len=3]

    so I would expect 4 to be the correct result here.

  • Loading more items...