We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9aa01f commit fb6ba0eCopy full SHA for fb6ba0e
461.hamming-distance.0.kt
@@ -0,0 +1,10 @@
1
+/*
2
+ * @lc app=leetcode id=461 lang=kotlin
3
+ *
4
+ * [461] Hamming Distance
5
+ */
6
+class Solution_hammingDistance_0 {
7
+ fun hammingDistance(x: Int, y: Int): Int {
8
+ return x.toString(2).padStart(32, '0').zip(y.toString(2).padStart(32, '0')).filter { it.first != it.second }.size
9
+ }
10
+}
0 commit comments