Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Algorithm] 문자열을 정수로 바꾸기 #60

Closed
hwangJi-dev opened this issue Jan 10, 2023 · 0 comments
Closed

[Algorithm] 문자열을 정수로 바꾸기 #60

hwangJi-dev opened this issue Jan 10, 2023 · 0 comments

Comments

@hwangJi-dev
Copy link
Owner

hwangJi-dev commented Jan 10, 2023

💬 문제

[코딩테스트 연습 - 문자열을 정수로 바꾸기](https://school.programmers.co.kr/learn/courses/30/lessons/12925)


💬 Idea

  • String을 Int로 형변환하자.

💬 풀이

func solution(_ s:String) -> Int {
    return Int(s)!
}

💬 알게된 것

  • String이 Int로 형변환될 때 부호값이 들어있어도 Int로 변환된다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant