Looking for digits that sum to 5


Suppose we're trying to create a number where the digits sum up to 5. You're given a positive integer as your input, n. Write a function that will take in n, and return a number with digits summing to exactly 5. You can assume the sum of the digits in the initial input will not exceed 5.

For example:

  • Given 2, you should return 23
  • Given 1, you should return 14
  • Given 20, you should return 203


Access restricted

Subscribe to premium account to see the solution.

Get premium now