Created
June 30, 2017 00:27
-
-
Save mattn/b9621b8fcff585be7d5a57a3ae55bc9a 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
| func check(s string) bool { | |
| i, l := 0, len(s) | |
| for ; i < l; i++ { | |
| if s[i] != '4' { | |
| break | |
| } | |
| } | |
| if i == 0 { | |
| return false | |
| } | |
| for ; i < l; i++ { | |
| if s[i] != '0' { | |
| return false | |
| } | |
| } | |
| return true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment