Sollicitatievraag bij TikTok

The first question was an easy algorithm problem, but after I solved it, I was given a different, harder algorithm problem.