You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
462 | [Minimum Moves to Equal Array Elements II](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/) |[Python](https://github.com/yennanliu/CS_basics/blob/master/leetcode_python/Bit_Manipulation/minimum-moves-to-equal-array-elements-ii.py) | _O(n)_ on average | _O(1)_ | Medium || AGAIN*
693 | [Binary Number with Alternating Bits](https://leetcode.com/problems/binary-number-with-alternating-bits/) | [Python](https://github.com/yennanliu/CS_basics/blob/master/leetcode_python/Bit_Manipulation/binary-number-with-alternating-bits.py) | _O(1)_ | _O(1)_ | Easy |`trick`| AGAIN*
435
435
762 | [Prime Number of Set Bits in Binary Representation](https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/) |[Python](https://github.com/yennanliu/CS_basics/blob/master/leetcode_python/Bit_Manipulation/prime-number-of-set-bits-in-binary-representation.py) | _O(1)_ | _O(1)_ | Easy |`trick`,`prime number`| AGAIN*
Copy file name to clipboardExpand all lines: leetcode_python/Bit_Manipulation/set-mismatch.py
+65-3Lines changed: 65 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,31 @@
1
+
# 645. Set Mismatch
2
+
# Easy
3
+
#
4
+
#
5
+
# Add to List
6
+
#
7
+
# The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another number in the set, which results in repetition of one number and loss of another number.
8
+
#
9
+
# Given an array nums representing the data status of this set after the error. Your task is to firstly find the number occurs twice and then find the number that is missing. Return them in the form of an array.
10
+
#
11
+
# Example 1:
12
+
# Input: nums = [1,2,2,4]
13
+
# Output: [2,3]
14
+
# Note:
15
+
# The given array size will in the range [2, 10000].
0 commit comments