Created
June 13, 2013 06:40
-
-
Save thisiswei/5771660 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
getFinal initial res = helper initial 1 0 | |
where helper total bet n = if n > (length res) - 1 || bet > total. | |
then total | |
else if res !! n == 'L'. | |
then helper (total-bet) (bet*2) (n+1) | |
else helper (total+bet) 1 (n+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment