Created
July 6, 2010 16:11
-
-
Save kmizu/465582 to your computer and use it in GitHub Desktop.
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
def hasA(s: String): Boolean = { | |
def hasA(i:int, s:String):boolean = { | |
if(i == s.length) return false | |
if(s(i) == 'a') return true | |
return hasA(i + 1, s) | |
} | |
hasA(0, s) | |
} | |
hasA("abc") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment