Leetcode Constraints Time Complexity In Cpp