Phone Interview
Given all the element symbols from the periodic table and a target word, return the total number of possible ways to compose that word using the element symbols.
For example, "Physics" can be composed in the following ways:
- P - H - Y - Si - C - S
- P - H - Y - Si - Cs
- P - H - Y - S - I - C - S
- P - H - Y - S - I - Cs
Onsite Round 1 (DSA)
Given n players (numbered 0 to n - 1) and a set of match results gameResults, where each pair (u, v) means player u beat player v. It's known that the player with the better rank (the smaller rank number) always wins. Based on this information, complete the following tasks:
- Calculate how many players' ranks can be uniquely determined.
- Return the specific ranks of those players.
Onsite Round 2 (DSA)
Given a sequence of piano notes (represented as integer positions on the keyboard) and a maximum hand span k — the range a hand can cover in one position, i.e. the maximum distance between the leftmost and rightmost keys it touches.
The hand can cover multiple notes within span k without lifting. If the next note to be played falls outside the hand's current coverage, the hand must lift and reposition. Calculate the minimum number of lifts needed to play the entire sequence of notes.
Example:
Input: notes = [1, 3, 5, 7, 9, 11], k = 4
Output: 2
Explanation:
- Initial position 1: covers keys 1-5 (span 4), plays notes 1, 3, 5
- First lift: move to cover keys 7-11, plays note 7
- Second lift: plays notes 9, 11
Discussion
Loading comments…