param { number [ ] } children param { number [ ] } biscuits function DeliverBiscuits ( children , biscuits ) { children = children . sort ( ( a , b ) => a - b ) ; biscuits = biscuits . sort ( ( a , b ) => a - b ) ; let result = 0 ; let chi = 0 ; let bis = 0 ; while ( chi < children . length && bis < biscuits . length ) { if ( children [ chi ] <= biscuits [ bis ] ) { result ++ ; chi ++ ; } bis ++ ; } return result ; } export { DeliverBiscuits } ;