Sunbit Interview Question

Write a solution for a task from leetcode.