lib/super_digit.rb
def refined_super_digit(n, k)
  if k == 1
    return super_digit(n)
  else
    result = super_digit(n)
    result *= k
    return super_digit(result)
  end
end
# Time Complexity - O(n) where n is equal to the number of digits in the n-number passed in the super_digit method or the number of digits in the result-number passed in the super_digit method.
# Space Complexity - O(n) where n is equal to the number of times the suger_digit method is placed on the call stack
Time Complexity - O(n) where n is equal to the number of digits in the n-number passed in the super_digit method or the number of digits in the result-number passed in the super_digit method.
Space Complexity - O(n) where n is equal to the number of times the suger_digit method is placed on the call stack
Time Complexity - O ( n ) where n is equal to the number of digits in the n - number passed in the super_digit method or the number of digits in the result - number passed in the super_digit method . Space Complexity - O ( n ) where n is equal to the number of times the suger_digit method is placed on the call stack
def refined_super_digit(n, k)
  if k == 1
    return super_digit(n)
  else
    result = super_digit(n)
    result *= k
    return super_digit(result)
  end
end
def refined_super_digit ( n , k ) if k == 1 return super_digit ( n ) else result = super_digit ( n ) result *= k return super_digit ( result ) end end
Time Complexity - O(n) where n is equal to the number of digits in the n-number passed in the super_digit method or the number of digits in the result-number passed in the super_digit method.
Time Complexity - O ( n ) where n is equal to the number of digits in the n - number passed in the super_digit method or the number of digits in the result - number passed in the super_digit method .
n
k