We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You go through and find pairs within the expression many times. Can someone help me with the complexity of this solution? It could be N+(N-1)+(N-2)+(N-3) which is O(N^2)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
Isn't this O(N^2)?
You go through and find pairs within the expression many times. Can someone help me with the complexity of this solution? It could be N+(N-1)+(N-2)+(N-3) which is O(N^2)