Benchmarking Finishing Order
Two Approaches
This blog post was inspired by the Task 1 of Weekly Challenge 396. Let’s start with the actual wording of the task:
You are given two arrays of integers,@orderand@friends.
The@order(size n) contains every integer from 1 to n exactly once. The@friendscontains IDs sorted in strictly increasing order.
Write a script to return the array containing IDs in finishing order.
Not clear? Let’s look at an example: