@@ -48,18 +48,18 @@ cargo test
48
48
#### Bit Manipulation
49
49
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
50
50
| -----| ---------------- | --------------- | --------------- | --------------- | ------------- | --------------| -----|
51
- 0136 | [ Single Number] ( https://leetcode.com/problems/single-number/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number.py ) <br > [ Rust] ( ./kamyu104/src/single_number.rs ) | _ O(n)_ | _ O(1)_ | Easy |||
52
- 0137 | [ Single Number II] ( https://leetcode.com/problems/single-number-ii/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number-ii.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number-ii.py ) <br > [ Rust] ( ./kamyu104/src/single_number_ii.rs ) | _ O(n)_ | _ O(1)_ | Medium |||
53
- 0190 | [ Reverse Bits] ( https://leetcode.com/problems/reverse-bits/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/reverse-bits.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/reverse-bits.py ) <br > [ Rust] ( ./kamyu104/src/reverse_bits.rs ) | _ O(1)_ | _ O(1)_ | Easy |||
54
- 0191 |[ Number of 1 Bits] ( https://leetcode.com/problems/number-of-1-bits/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/number-of-1-bits.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/number-of-1-bits.py ) <br > [ Rust] ( ./kamyu104/src/number_of_1_bits.rs ) | _ O(1)_ | _ O(1)_ | Easy |||
55
- 0201 | [ Bitwise AND of Numbers Range] ( https://leetcode.com/problems/bitwise-and-of-numbers-range/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/bitwise-and-of-numbers-range.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/bitwise-and-of-numbers-range.py ) <br > [ Rust] ( ./kamyu104/src/bitwise_and_of_numbers_range.rs ) | _ O(1)_ | _ O(1)_ | Medium ||
56
- 0231 | [ Power of Two] ( https://leetcode.com/problems/power-of-two/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/power-of-two.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/power-of-two.py ) <br > [ Rust] ( ./kamyu104/src/power_of_two.rs ) | _ O(1)_ | _ O(1)_ | Easy | LintCode |
57
- 0260 | [ Single Number III] ( https://leetcode.com/problems/single-number-iii/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number-iii.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number-iii.py ) <br > [ Rust] ( ./kamyu104/src/single_number_iii.rs ) | _ O(n)_ | _ O(1)_ | Medium ||
58
- 0268| [ Missing Number] ( https://leetcode.com/problems/missing-number/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/missing-number.cpp ) , [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/missing-number.py ) <br > [ Rust] ( ./kamyu104/src/missing_number.rs ) | _ O(n)_ | _ O(1)_ | Medium | LintCode ||
51
+ 0136 | [ Single Number] ( https://leetcode.com/problems/single-number/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number.py ) <br >------br > [ Rust] ( ./kamyu104/src/single_number.rs ) | _ O(n)_ | _ O(1)_ | Easy |||
52
+ 0137 | [ Single Number II] ( https://leetcode.com/problems/single-number-ii/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number-ii.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number-ii.py ) <br >------br > [ Rust] ( ./kamyu104/src/single_number_ii.rs ) | _ O(n)_ | _ O(1)_ | Medium |||
53
+ 0190 | [ Reverse Bits] ( https://leetcode.com/problems/reverse-bits/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/reverse-bits.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/reverse-bits.py ) <br >------br > [ Rust] ( ./kamyu104/src/reverse_bits.rs ) | _ O(1)_ | _ O(1)_ | Easy |||
54
+ 0191 |[ Number of 1 Bits] ( https://leetcode.com/problems/number-of-1-bits/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/number-of-1-bits.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/number-of-1-bits.py ) <br >------br > [ Rust] ( ./kamyu104/src/number_of_1_bits.rs ) | _ O(1)_ | _ O(1)_ | Easy |||
55
+ 0201 | [ Bitwise AND of Numbers Range] ( https://leetcode.com/problems/bitwise-and-of-numbers-range/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/bitwise-and-of-numbers-range.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/bitwise-and-of-numbers-range.py ) <br >------br > [ Rust] ( ./kamyu104/src/bitwise_and_of_numbers_range.rs ) | _ O(1)_ | _ O(1)_ | Medium ||
56
+ 0231 | [ Power of Two] ( https://leetcode.com/problems/power-of-two/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/power-of-two.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/power-of-two.py ) <br >------br > [ Rust] ( ./kamyu104/src/power_of_two.rs ) | _ O(1)_ | _ O(1)_ | Easy | LintCode |
57
+ 0260 | [ Single Number III] ( https://leetcode.com/problems/single-number-iii/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/single-number-iii.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/single-number-iii.py ) <br >------br > [ Rust] ( ./kamyu104/src/single_number_iii.rs ) | _ O(n)_ | _ O(1)_ | Medium ||
58
+ 0268| [ Missing Number] ( https://leetcode.com/problems/missing-number/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/missing-number.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/missing-number.py ) <br >------br > [ Rust] ( ./kamyu104/src/missing_number.rs ) | _ O(n)_ | _ O(1)_ | Medium | LintCode ||
59
+ 0318| [ Maximum Product of Word Lengths] ( https://leetcode.com/problems/maximum-product-of-word-lengths/ ) | [ C++] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/C++/maximum-product-of-word-lengths.cpp ) [ Python] ( https://github.com/kamyu104/LeetCode-Solutions/blob/master/Python/maximum-product-of-word-lengths.py ) <br >------br > [ Rust] ( ./kamyu104/src/maximum_product_of_word_lengths.rs ) | _ O(n)_ ~ _ O(n^2)_ | _ O(n)_ | Medium || Bit Manipulation, Counting Sort, Pruning|
59
60
60
61
kamyu104/src/main.rsCopy file name to clipboard Expand all lines: kamyu104/src/main.rs +1 Lines changed: 1 addition & 0 deletions Original file line number Diff line number Diff line change 1
1
mod bitwise_and_of_numbers_range;
2
+ mod maximum_product_of_word_lengths;
2
3
mod missing_number;
3
4
mod number_of_1_bits;
4
5
mod power_of_two;
Original file line number Diff line number Diff line change
1
+ pub struct Solution { }
2
+ impl Solution {
3
+ pub fn max_product ( words : Vec < String > ) -> i32 {
4
+ 0
5
+ }
6
+ }
7
+
8
+ #[ cfg( test) ]
9
+ mod tests {
10
+ use super :: * ;
11
+
12
+ #[ test]
13
+ fn test_max_product ( ) {
14
+ // assert_max_product!(Solution::max_product(vec!["abcw","baz","foo","bar","xtfn","abcdef"]), 16);
15
+ // assert_max_product!(Solution::max_product(vec!["a","ab","abc","d","cd","bcd","abcd"]), 4);
16
+ // assert_max_product!(Solution::max_product(vec!["a","aa","aaa","aaaa"]), 0);
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments