How would you explain the time complexity of your solution for a specific algorithm and optimize it further?