Can You Solve Leetcode With Assembly? Yes (#20 Valid Parantheses)
Can you use assembly on leetcode? Yes! Albeit it's inline assembly...
- I don't have much experience estimating time/space complexity, but will go with this:
Time: Checking a closing brace for each opening brace in the string, adding/popping 1 at a time from a 'stack'. This happens up to the length of the input string (N). That should be O(N)?
Space: Allocating an additional array the size of the input string (N). This should also be O(N)?
Let me know in the comments if that is incorrect!
- Any visual recording glitches are from running OBS on the 2nd monitor and recording firefox on the main 144fps monitor, I think. Seems to be isolated mainly to firefox. Not sure why it does that sometimes.
- Leetcode's vim emulation does not work for C-d to move down half a page, that deletes a line for me. Frustrating, as C-u does work fine.
Misc. Links:
https://en.wikipedia.org/wiki/X86_calling_conventions
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html
https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html
Join the Community Discord: https://discord.gg/yKm4T89QFn
Contact:
email: fuegoqueso@gmail.com
twitter: @Queso_Fuego
twitch: https://www.twitch.tv/queso_fuego
- Let me know if there's anything specific you'd like to see, inline asm leetcode problems or otherwise!
Software:
davinci resolve: https://www.blackmagicdesign.com/products/davinciresolve/
OBS Studio: https://obsproject.com/
Peripherals:
Camera: Sony ZV-1, Elgato Camlink 4k
Microphone: Shure SM7B, Cloudlifter CL-1, Focusrite Scarlett Solo
Keyboard: HHKB Pro Hybrid Type S, white/blank keycaps
Mouse: Logitech M590
Updates may be on twitter, YouTube channel community tab, or the community discord, if I remember to update anything.
Music credits:
Back Home by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
#leetcode #assembly #programming