Byunggyu's result equals multiplied by the sum of the decimal digits of . We can find this sum by extracting the digits one at a time.
Start with and . While is positive, repeat the following operations:
When the loop ends, print . Let be the number of digits of . The time complexity for one case is , and the space complexity is .
Solution written by GPT6