Databricks Interview Question

The algorithm interview included a LeetCode Hard–level problem.