Skip to content

Commit cd76a47

Browse files
committed
Runtime: 2 ms (Top 97.56%) | Memory: 46.7 MB (Top 58.76%)
1 parent 2f2e3b5 commit cd76a47

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
// Runtime: 2 ms (Top 97.56%) | Memory: 46.7 MB (Top 58.76%)
12
class Solution {
23
public List<Integer> twoOutOfThree(int[] nums1, int[] nums2, int[] nums3) {
34
int[] bits = new int[101];
4-
for (int n : nums1) bits[n] |= 0b110;
5-
for (int n : nums2) bits[n] |= 0b101;
6-
for (int n : nums3) bits[n] |= 0b011;
5+
for (int n : nums1) bits[n] |= 0b110;
6+
for (int n : nums2) bits[n] |= 0b101;
7+
for (int n : nums3) bits[n] |= 0b011;
78
List<Integer> result = new ArrayList();
89
for (int i = bits.length - 1; i > 0; i--)
910
if (bits[i] == 0b111)
1011
result.add(i);
1112
return result;
1213
}
13-
}
14+
}

0 commit comments

Comments
 (0)