function solution(sizes) {
var answer = 0;
let arr = [];
let arr2 = [];
sizes.forEach(size=>{
if(size[0] < size[1]){
arr.push(size[0])
arr2.push(size[1])
}
else {
arr.push(size[1])
arr2.push(size[0])
}
})
let max1 = Math.max(...arr);
let max2 = Math.max(...arr2);
return max1*max2;
}