注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
第一題HackerRank的題目 Initial Public Offering
給定 bids = 2d array , totalShares= int
bids = [[user1 Id, wanted number of shares, bidding price, timestamp ],
[user2 Id, wanted number of shares, bidding price, timestamp ],
of ways to construct the target by consecutive sum)
假設 target = 21
可以用 1+2+3+4+5+6 = 21
6+7+8 = 21
10+11 = 21
所以有三種方法,直接 return 3
|