Skip to content

Instantly share code, notes, and snippets.

Drew Fitzpatrick DrewFitz

Block or report user

Report or block DrewFitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DrewFitz
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) {
@DrewFitz
DrewFitz / puddle.py
Last active Dec 27, 2015
Twitter Interview Solution Problem described here: http://qandwhat.apps.runkite.com/i-failed-a-twitter-interview/ It's messy, but it solves it in one pass
View puddle.py
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:
break
You can’t perform that action at this time.