This website requires JavaScript.
Explore
Help
Register
Sign In
humza
/
sml-projects
Watch
1
Star
0
Fork
0
You've already forked sml-projects
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
886f384490004009c62929c48d63fc16c9fda063
sml-projects
/
temp.txt
Humza Shahid
886f384490
when deleting inside pair, instead of searching either for either chr1 or chr2 and stopping at first match, search instead for openChr and closeChr, and keep an integer tracking what level of nesting we are at. This gives us the behaviour we want, which is to delete the pair at the correct level of nesting. When we encounter openChr, we increment the nesting counter by 1 and continue searching. When we encounter closeChr, if the nesting counter is 0, we return the current index, but if the nesting counter is higher than 0 when encounter closeChr, we decrement the nesting counter by 1 and continue searching.
2026-01-02 18:50:04 +00:00
2 lines
18 B
Plaintext
Raw
Blame
History
( ( ( hello ) ) )
Reference in New Issue
View Git Blame
Copy Permalink