Trigger interview question

how to solve one leet code problem