I hereby claim:
- I am daltonhuynh on github.
- I am dalton (https://keybase.io/dalton) on keybase.
- I have a public key whose fingerprint is C7A0 43F7 9873 29F2 7B2F D1C4 85D4 D513 907F AC33
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Verifying that +dalton is my Bitcoin username. You can send me #bitcoin here: https://onename.io/dalton |
I hereby claim:
To claim this, I am signing this object:
// simple map and fold left/right implementations | |
// in scala using pattern matching for List[Int] | |
def map(list:List[Int], f:(Int) => Int):List[Int] = { | |
list match { | |
case Nil => Nil | |
case head::tail => f(head)::map(tail, f) | |
} | |
} |
class String | |
def palindrome? | |
front = 0 | |
back = self.length - 1 | |
while front < back do | |
return false if self[front] != self[back] | |
front += 1 | |
back -= 1 |