Created
April 28, 2019 06:58
-
-
Save AndreasHassing/62b3fd51d5e4f7a16c6e5b410355673c to your computer and use it in GitHub Desktop.
Solve HackerRank problems with F# (FSharp)
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
| /// Read all lines from stdin into an array of lines. | |
| let lines = stdin.ReadToEnd().Split('\n') | |
| // Now, all(?) problems on HackerRank can be solved using the `lines` binding. | |
| // If you perform `stdin.ReadLine()` before the call to `stdin.ReadToEnd()` (to get a N or X variable, for instance), | |
| // it will not be picked up by `stdin.ReadToEnd()`, yielding the expected behavior. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment