Skip to content

Instantly share code, notes, and snippets.

@miketheinkman
miketheinkman / brace_sanity.py
Created April 3, 2019 04:18
Interview question with irritating (but super simple once the pressure was off) edge case
def brace_sanity_check(test_string):
"""Return True if braces brackets and parens are sane
"""
open_paren = 0
open_bracket = 0
open_brace = 0
for s in test_string:
if s == "(":
// first go to https://www.facebook.com/groups/XXXX/members/
// then paste this in the javascript console
deleteAll = [];
deleteAll.elms = [];
deleteAll.canClick = function (el) {
return (typeof el != 'undefined') && (typeof el.click != 'undefined');
}
deleteAll.load = function() {