Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You checked all permutations of the digits which take so much time O(2^n). Actually there is a O(n^2) way to solve the problem
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No, there are only 12 tests in Python and the longest is 14 chars long, it's a problem with your loops.
I guess in 'Attempt', there will be so many tests with long inputs, so allocated total 12000ms time for running all tests in 'Attempt' section is not eneough.
I only have two loops in total(WHILE and FOR), and they don't run more than lengh(for number of iterations) of input string.
It seems you have an infinite loop, because the input isn't that long to cause timeouts.
Quick question,
I have come up with a solution that seems to be working but when I hit 'Attempt', it gives me error saying 'Execution Time Runout'. I think this site allows only 12000ms for all 'Attempt Tests' to run. Any suggestions to overcome this issue?
I can't optimize my solution anymore:)
I have tested validBraces("(({{[[]]}}))"). It takes 0.97ms on my machine with VSCode editor.