Databricks interview question

1 easy, 2 medium, 1 hard leetcode problem