Domanda di colloquio di Databricks

Q: Codility-like questions, it's around the medium diffiulty