1
var isPossible = function (target) {5
for (let i = target.length - 1; i >= 0; i--) {11
if (max === 1) return true; // if max itself is 1 return true14
for (let i = 0; i < target.length; i++) {19
// If total=1,it means only one element was remaining apart from max and its value is 1 return true20
// eg target=[10,1] we started with [1,1] so next steps would be [2,1]->[3,1]->...[10,1] we can make sure it leads to target21
if (total === 1) return true;22
// max should be greater than remaining nums sum OR if total is 0 it would lead to infinite loop( num%0 === NaN) so return false23
if (max <= total || total === 0) return false;25
if (max < 1) return false; // it should not be less than 128
return isPossible(target);