Databricks Interview Question

1 easy, 2 medium, 1 hard leetcode problem