Ad
  • Custom User Avatar

    Ok i understood now. Its no where mentioned(or maybe i didnt understand) taht first we have to check for the enire number.
    What i understood from the question was that

    952406 -> Remove first num -> 9 Bingo multiple of 3
    similarly thats why i asked why is 36.
    but now i understood. Thanks.

  • Default User Avatar

    Let's start with a bigger number first and it will become clear.
    952406 => not a multiple of three
    95240 => not a multiple of three
    9524 => not a multiple of three
    952 => not a multiple of three
    95 => not a multiple of three
    9 => Bingo! return 9

    36 => Bingo! Remove nothing, return 36

  • Custom User Avatar

    Return n if the input is already a multiple of three

    last number starts from the right (units' place, then tens', then hundreds' ...)

  • Custom User Avatar

    In the tests why does 36 return 36?
    and what do they mean by last number? is it starting from left or right?
    and from any side they start 36 should either return 3 or return 6 as both are multiple of 3. The question is not understood to me. Can please anyone help me understand the problem statement.

  • Custom User Avatar

    So is this a wrong test? As my test is also failing here

  • Custom User Avatar

    nope, you still need to do import kotlin.math.pow

  • Custom User Avatar

    import here? how? I am using kotlin language

    Math.pow(x,y) in JAVA. in kotling we do x.pow(y)

  • Default User Avatar

    I think the method 'pow' belongs to the Math class. It's static so you invoke it like this 'Math.pow(someInt,someOtherInt)'
    And it needs two parameters, no?
    The Math class lives in java.lang so you don't need to import it.
    Apologies if you're thinking of a different pow method.

  • Default User Avatar

    You have to import it before you can use it.

  • Custom User Avatar

    Why does it give tis error : error: unresolved reference: pow
    sum += (listOfNumbers[i].toDouble().pow(p + i))

    I am trying to use the "pow" funtion. why does it say unresolved reference: pow?