Algorithm & Data Structure/Problem Solving1 [leetcode] 1009. Complement of Base 10 Integer Complement of Base 10 Integer - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 주어진 정수를 이진수로 표현했을 때 모든 0을 1로, 1을 0으로 바꿔서 얻을 수 있는 정수를 보수라고 한다. 예를 들어, 정수 5를 이진수로 나타내면 "101"이고 그 보수는 이진수 "010"으로 표현되는 정수 2이다. 정수 n이 주어졌을 때, 그 보수를 반환하시오. 조건 0 ≤ n < 1,000,000,000 해결 x = n + n' n' = n - .. 2022. 1. 5. 이전 1 다음