Advertisement
DiManco

Untitled

Sep 22nd, 2020
2,318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getProfit(list: number[]): number {
  2.   const maxCost = Math.max.apply(null, list);
  3.   const minCost = Math.min.apply(null, list);
  4.  
  5.   return maxCost - minCost;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement