Skip to content

Instantly share code, notes, and snippets.

@zbunde
Created July 21, 2015 15:37
Show Gist options
  • Save zbunde/451fb5457144125b4e70 to your computer and use it in GitHub Desktop.
Save zbunde/451fb5457144125b4e70 to your computer and use it in GitHub Desktop.
## Problem 1
We are going to take sentence and sort it alphabetically by the letters in each word. So, for instance, if you take the word "hello" and sort the letters in it, you get "ehllo". If you take the two words "hello world", and sort the letters in each word, you get "ehllo dlorw".
#### Input
One english sentence.
#### Output
words sorted.
## Problem 2
Write a function that validates the following palindrome:
"Dammit I'm Mad" by Demetri Martin
## Input
" Dammit I’m mad.
Evil is a deed as I live.
God, am I reviled? I rise, my bed on a sun, I melt.
To be not one man emanating is sad. I piss.
Alas, it is so late. Who stops to help?
Man, it is hot. I’m in it. I tell.
I am not a devil. I level “Mad Dog”.
Ah, say burning is, as a deified gulp,
In my halo of a mired rum tin.
I erase many men. Oh, to be man, a sin.
Is evil in a clam? In a trap?
No. It is open. On it I was stuck.
Rats peed on hope. Elsewhere dips a web.
Be still if I fill its ebb.
Ew, a spider… eh?
We sleep. Oh no!
Deep, stark cuts saw it in one position.
Part animal, can I live? Sin is a name.
Both, one… my names are in it.
Murder? I’m a fool.
A hymn I plug, deified as a sign in ruby ash,
A Goddam level I lived at.
On mail let it in. I’m it.
Oh, sit in ample hot spots. Oh wet!
A loss it is alas (sip). I’d assign it a name.
Name not one bottle minus an ode by me:
'Sir, I deliver. I’m a dog'
Evil is a deed as I live.
Dammit I’m mad."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment