Phone Screen - SDE-3
Anonymous User
856

Had phone screening yesterday. Tried my best to write what I rememebr from the interveiw Imagine you're building a chain of people, each holding hands in a line. You want the line to have exactly n people.
Each person has a number on their shirt—between 1 and maxValue. But there’s one rule :No one will hold hands with someone unless their number is a multiple of the person before them.So if someone has a 2 on their shirt, the next person must have 2, 4, 6, etc. If the first person has a 1? Everyone's welcome—1 goes with anyone.Now, you want to count: How many different lines like this can you form?

Comments (6)