After this: Name the tool and the cost for five problems you have not seen.
This challenge has five steps, one problem each, and none of the problems appeared in the lessons. For each one, read the statement, find the cue, and pick the tool. Then say what that tool costs. Each step is scored on its own; you can try as many times as you like, and hints work as they do in the lessons. The table of cues is there if you want it, but try each step without it first.
Step 1 of 5Seen before in a stream
The tool
Numbers arrive one at a time. After each one, say whether that number has arrived before. Which tool?
0 of 3 hints used
The cost
With a hash set, what does it cost to handle n numbers?
0 of 3 hints used
The tool
Find the length of the longest stretch of a word in which no letter appears twice. Which tool?
0 of 3 hints used
The cost
What does the sliding window cost for a word of n letters?
0 of 3 hints used
The tool
Some courses need other courses first. Put all the courses in an order so that every course comes after the ones it needs. Which tool?
0 of 3 hints used
The cost
With c courses and r “needs” rules, what does the topological order cost?
0 of 3 hints used
The tool
You have the distance from home to each of n stores. Return the 3 closest. Which tool?
0 of 3 hints used
The cost
What does the heap of size 3 cost for n stores?
0 of 3 hints used
The tool
Is the price 41 in this sorted list of a million prices? Which tool?
0 of 3 hints used
The cost
About how many probes does binary search need for a million sorted prices?
0 of 3 hints used
You can now
Name the tool and its cost for five problems you had not seen: a seen-before stream, the longest stretch with no repeat, courses in a safe order, the 3 closest stores and one price in a sorted million.