Logo
Explore Help
Register Sign In
humza/sml-projects
1
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
Powered by Gitea Version: 1.25.5 Page: 20ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API