Skip to content

Commit 854a834

Browse files
committed
code update
1 parent d4608fd commit 854a834

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lcci/05.06.Convert Integer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Solution {
9494
```swift
9595
class Solution {
9696
func convertInteger(_ A: Int, _ B: Int) -> Int {
97-
return (A ^ B).nonzeroBitCount
97+
return (Int32(A) ^ Int32(B)).nonzeroBitCount
9898
}
9999
}
100100
```

lcci/05.06.Convert Integer/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl Solution {
111111
```swift
112112
class Solution {
113113
func convertInteger(_ A: Int, _ B: Int) -> Int {
114-
return (A ^ B).nonzeroBitCount
114+
return (Int32(A) ^ Int32(B)).nonzeroBitCount
115115
}
116116
}
117117
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Solution {
22
func convertInteger(_ A: Int, _ B: Int) -> Int {
3-
return (A ^ B).nonzeroBitCount
3+
return (Int32(A) ^ Int32(B)).nonzeroBitCount
44
}
5-
}
5+
}

0 commit comments

Comments
 (0)