Redian新闻
>
Moutain view 一公司的面试题
avatar
Moutain view 一公司的面试题# JobHunting - 待字闺中
b*d
1
You are asked to build a sum by picking one integer from each list. Find the
n largest sums amongst all the combinations of picking an integer from each
list, where n is some positive value. For example if n is 1, then you are
simply expected to find the sum that can be created by adding together the
highest integers in all the lists.
For example, given the lists:
[5,4,3,2,1]
[4,1]
[5,0,0]
[6,4,2]
[1]
and a value of 3 for n your procedure should return the sums
21 (5 + 4 + 5 + 6 + 1)
20 (4 + 4 + 5 + 6 + 1)
19 (3 + 4 + 5 + 6 + 1)
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。