Databricks interview question

traditional algorithm leetcode medium and hard