This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expr = inp.split('\n') | |
# PART 1 | |
# expr is a simple expression that has no parentheses | |
def evaluate(expr, part=1): | |
if part == 2: | |
if expr.find('(') > -1: | |
return [str(eval(expr))] | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input1 = ``; | |
let input = input2.split("\n"); | |
function dec2bin(dec) { | |
return (dec >>> 0).toString(2); | |
} | |
function part1() { | |
const mem = {}; |