Skip to content

Commit bbb2f45

Browse files
authored
Fixed formatting 0502-ipo.js
1 parent d672b2c commit bbb2f45

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

javascript/0502-ipo.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
var findMaximizedCapital = function(k, w, profits, capital) {
1212

1313
const maxQueue = new MaxPriorityQueue({
14-
compare: (a,b) => {
14+
compare: (a, b) => {
1515
return b[0] - a[0];
1616
}
1717
});
1818

1919
const minQueue = new MinPriorityQueue({
20-
compare: (a,b) => {
20+
compare: (a, b) => {
2121
return a[0] - b[0];
2222
}
2323
});
@@ -26,20 +26,20 @@ var findMaximizedCapital = function(k, w, profits, capital) {
2626
return [profit, capital[idx]];
2727
});
2828

29-
for(let i = 0; i < pc.length; i++) {
30-
minQueue.enqueue( [pc[i][1], pc[i][0]] );
29+
for (let i = 0; i < pc.length; i++) {
30+
minQueue.enqueue([pc[i][1], pc[i][0]]);
3131
}
3232

3333
let cc = w;
34-
while(k && (!maxQueue.isEmpty() || !minQueue.isEmpty()) ) {
34+
while (k && (!maxQueue.isEmpty() || !minQueue.isEmpty())) {
3535

3636
// add all the project that we can take to maxQ
37-
while(!minQueue.isEmpty() && cc >= minQueue.front()[0]) {
37+
while (!minQueue.isEmpty() && cc >= minQueue.front()[0]) {
3838
const curr = minQueue.dequeue();
3939
maxQueue.enqueue([curr[1], curr[0]]);
4040
}
4141

42-
if(!maxQueue.isEmpty()) {
42+
if (!maxQueue.isEmpty()) {
4343
cc += maxQueue.dequeue()[0];
4444
}
4545

0 commit comments

Comments
 (0)