250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록Hamming distance (1)
N
(Leet Code JS)Hamming Distance
https://leetcode.com/problems/hamming-distance/ Hamming Distance - 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 주어진 x와 y를 이진수로 바꿔서 각 자릿수를 비교했을 때 다른 비트의 수를 구하면 된다. 먼저 x를 이진수로 바꾼 값을 저장할 배열 xArr과 y를 이진수로 바꿔 저장할 배열 yArr을 선언한다. 그리고 리턴할 answer = 0. divide라는 함수를 이용해 인자로 들어온 n을 이진수로 만들어..
Leet Code 알고리즘
2022. 5. 13. 16:51