loading...

re: Daily Challenge #256 - How Many Are Smaller Than I? VIEW POST

FULL DISCUSSION
 

const smaller = arr => arr.reduce((c,a,i)=>{
   for(let j =0; j < i; j++) { 
       c[j] = (c[j] || 0) + arr[j] > a ? 1 : 0 
   }
   return c
}, [])

code of conduct - report abuse