Crunchyroll Interview Question

Asked to solve leetcode style garbage