[Daily Coding Problem 70] Nth perfect number

Posted lz87

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Daily Coding Problem 70] Nth perfect number相关的知识,希望对你有一定的参考价值。

This problem was asked by Microsoft.

A number is considered perfect if its digits sum up to exactly 10.

Given a positive integer n, return the n-th perfect number.

For example, given 1, you should return 19. Given 2, you should return 28.

 

This is one of the problem where you can scratch your head for hours, trying to come up with a "smart" solution but just can‘t. Unfortunately, it doesn‘t seem like there‘s a faster way than simply iterating over all the numbers and keeping track of the current perfect number until we hit n

 

以上是关于[Daily Coding Problem 70] Nth perfect number的主要内容,如果未能解决你的问题,请参考以下文章

Daily Coding Problem: Problem #339

[Daily Coding Problem 290] Quxes Transformation

[Daily Coding Problem 250] Cryptarithmetic Puzzle

[Daily Coding Problem 68] Count Pairs of attacking bishop pairs

[Daily Coding Problem 24] Implement locking in a binary tree.

[Daily Coding Problem 294] Shortest round route with rising then falling elevations