Solve the given coding question.
Sigiloso
First, I gave a Brute Force Solution. Then I used the information provided to get to a more efficient approach. And I explained each and every step while telling him my logic. In the end I gave the complexity of my solution.