NITIN23329 / LeetCode

This repo contains several problems solved at leetcode
MIT License
1 stars 0 forks source link

Reduce the time complexity of solution from O(n^2) to O(n) #1

Open NITIN23329 opened 4 years ago

NITIN23329 commented 4 years ago

Problem link : https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/ O(n^2) solution : https://github.com/NITIN23329/LeetCode/blob/c6b42b50f0692df6ad329fbacb0c7e8dd7e191f1/Stack/ReverseSubstringBtwEachParentheses.java#L1