Coveo Solutions Interview Question

Leetcode question with pointers and space time complexity