DEV Community

Discussion on: Daily Challenge #16 - Number of People on the Bus

Collapse
 
kvharish profile image
K.V.Harish

My solution in js

const totalPeopleInBus = (arr) => arr.reduce((total, [enter, exit]) => total + enter - exit, 0);