Databricks Array Distinct Javascript Interview