Research OA: best value ratio, shuttle trips and grid commands
A multi-part online assessment.
- Given
ratingsandprices, return the index with the highest rating-to-price ratio, choosing the smaller index on ties. Compare the fractions exactly, without floating point. - A traveller must make a number of round trips between A and B. Departure times from A to B and from B to A are given as sorted lists. Starting at time 0 and always taking the first departure not earlier than the current time, when are the trips finished?
- Apply a list of commands (such as swapping rows or columns) to a 2D array in order and return the result.
No answer yet. Write the first one; the best answer gets endorsed.
