1 |
class { |
A better explanation why this technique works-
Let’s say we have an array - [2,1,4,5,2,4,1].
What we are doing is essentially this-
=> 0 ^ 2 ^ 1 ^ 4 ^ 5 ^ 2 ^ 4 ^ 1
=> 0^ 2^2 ^ 1^1 ^ 4^4 ^5 (Rearranging, taking same numbers together)
=> 0 ^ 0 ^ 0 ^ 0 ^ 5
=> 0 ^ 5
=> 5 🙂
Intersection of Two Arrays
1 |
class { |
使用迭代器初始化set
从关联容器删除元素
c.erase(k)
从c中删除每个关键字为k的元素。返回一个size_type值,指出删除元素的数量
[Happy Number] (https://leetcode.com/explore/learn/card/hash-table/183/combination-with-other-algorithms/1131/)
1 |
class { |
近期评论