Finding all possible subarrays
for ( let i = 0 ; i < len ; i ++ ) { for ( let j = i ; j < len ; j ++ ) { let val = digitProduct ( digits , i , j ) ; if ( products . includes ( val ) ) return false ; else products . push ( val ) ; } } return true ; }