var max for var cost length for var size length if cost size max max c

1
2
3
4
5
6
7
8
var max = 0;
for (var i = 0; i < cost.length; i++) {
for (var j = i; j < size.length; j++) {
if (cost[i] * size[j] > max) {
max = cost[i] * size[j];
}
}
}