Skip to content

Instantly share code, notes, and snippets.


Drew Fitzpatrick DrewFitz

View GitHub Profile
DrewFitz /
Last active Dec 27, 2015
Twitter Interview Solution Problem described here: It's messy, but it solves it in one pass
def puddle(xs):
result = 0
unresolved = []
for i in range(len(xs)):
y = xs[i]
if len(unresolved) > 0:
while y > unresolved[-1][0]:
z = unresolved.pop()[0]
if len(unresolved) == 0:
DrewFitz / mathcaps.c
Last active Aug 29, 2015
Who likes unicode allcaps???
View mathcaps.c
Compile: make mathcaps
Usage: ./mathcaps "the string to convert"
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {