Ad
  • 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

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

  • 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.