Created
August 6, 2019 00:58
-
-
Save cg4jins/6c081da280cf3ca74fcb87689e463f22 to your computer and use it in GitHub Desktop.
This file contains 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
class Solution { | |
fun solution(s: String): Int { | |
//return s.toInt() | |
if (s[0] == '-') { | |
return Integer.parseInt(s.substring(1)) * -1 | |
} | |
return Integer.parseInt(s) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment