How should I practise the Leetcode problems? Sometimes due to low constraints, my non-optimal solution gets accepted, but it is not right.
Should i follow this approach-
- Solve the problem.
- Go to discuss and check if other optimal solution exists
Or is there any other way. Any suggestion would be appreciated.