DEV Community

Discussion on: Daily Challenge #114 - Speed Control

Collapse
 
pavi2410 profile image
Pavitra Golchha • Edited

JS

function result(x, s) {
  return Math.floor(
    Math.max(...
      x.reduce((a,b)=>[`${a}-${b}`, b])[0]
      .split(",")
      .map(e=>eval(e))
      .map(e=>Math.abs(e))
      .map(e=>3600*e/s)
    )
  )
}