Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4aeb04a

Browse files
authoredJun 12, 2021
Update 502-ipo.js
1 parent 25d9987 commit 4aeb04a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎502-ipo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* @return {number}
77
*/
88
const findMaximizedCapital = function(k, W, Profits, Capital) {
9-
let idxArr = Profits.map((_, i) => i).sort((ia, ib) => Profits[ib] - Profits[ia]);
9+
const idxArr = Profits.map((_, i) => i).sort((ia, ib) => Profits[ib] - Profits[ia]);
1010
while (k) {
11-
let choose = idxArr.findIndex(i => Capital[i] <= W);
11+
const choose = idxArr.findIndex(i => Capital[i] <= W);
1212
if (choose == -1) return W;
1313
W += Profits[idxArr[choose]];
1414
idxArr.splice(choose, 1);

0 commit comments

Comments
 (0)
Please sign in to comment.