Skip to content

Commit 9f0880c

Browse files
committed
feat: Add solution for LeetCode problem 191
1 parent c4d0a06 commit 9f0880c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

number-of-1-bits/WhiteHyun.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// 191. Number of 1 Bits
3+
// https://leetcode.com/problems/number-of-1-bits/description/
4+
// Dale-Study
5+
//
6+
// Created by WhiteHyun on 2024/05/19.
7+
//
8+
9+
final class Solution {
10+
func hammingWeight(_ n: Int) -> Int {
11+
n.nonzeroBitCount
12+
}
13+
}

0 commit comments

Comments
 (0)