Ad
Code
Diff
  • const getMin = (l) => l.filter(i => i > 0).sort((a, b) => a - b)[0] || 0
    
    • function getMin(list) {
    • x = Math.min(...list.filter(i => i > 0));
    • return x !== Infinity ? x : 0
    • }
    • const getMin = (l) => l.filter(i => i > 0).sort((a, b) => a - b)[0] || 0