Questions tagged «smooth-numbers»

21
棘手的Google面试问题
我的一个朋友正在面试工作。采访中的一个问题让我思考,只想要一些反馈。 有2个非负整数:i和j。给定以下方程式,找到一种(最佳)解决方案以对i和j进行迭代,以对输出进行排序。 2^i * 5^j 因此,前几轮如下所示: 2^0 * 5^0 = 1 2^1 * 5^0 = 2 2^2 * 5^0 = 4 2^0 * 5^1 = 5 2^3 * 5^0 = 8 2^1 * 5^1 = 10 2^4 * 5^0 = 16 2^2 * 5^1 = 20 2^0 * 5^2 = …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.