← Questions
Quickselect, distance between tree nodes, and substrings with a prefix
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Three problems from one loop:
- Find the k-th largest element with quickselect. Compare the approaches and how to choose the pivot, then implement one.
- Given the edges of a tree and two nodes, return how far apart they are. Clarify duplicate edges, whether the edges always form a tree, and missing or identical nodes.
- Given a string and a target, count the substrings that start with the target. Follow-up: the length of the shortest substring that contains the target.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
