01 Package 背包 Dynamic Programming
I've been studied 01 Package for so many times. But I keep forgetting it. It costs me so many energy every time I learn, especially for the optimization of space complexity. So I take notes this time.
I've been studied 01 Package for so many times. But I keep forgetting it. It costs me so many energy every time I learn, especially for the optimization of space complexity. So I take notes this time.
This is bit XOR Operation.
If we combine the left search with the right search, we need to make the lines with shorter height move.
We can simulate the order of the place order. Store them in a matrix and then combine the answer string.
Given a string s, find the length of the longest substring without repeating characters.
Normally, if I want to find whether the key exists in map STL(C++), the first thing come up to my mind is if(map1[key1])
. However, this is wrong, because if there is no key equals to key1
, map1[key1]
will return 0 and if there is a key1
but its value is 0
, then it will also return 0; So this method is not feasible.