algorithm - highest parallel event time -


i've had interview question , know how solve that: have tried find answer on google , here no success "given long list of events start point , end point, find time intersection highest "

not allowed use complex data structure

thank

sort times ascending order , run along them, incrementing counter @ start , decrementing @ end. time highest intersection should time when counter reached highest value.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -