Skip to content

Instantly share code, notes, and snippets.

@cg4jins
Created August 6, 2019 00:58
Show Gist options
  • Save cg4jins/6c081da280cf3ca74fcb87689e463f22 to your computer and use it in GitHub Desktop.
Save cg4jins/6c081da280cf3ca74fcb87689e463f22 to your computer and use it in GitHub Desktop.
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