Summary:
1. vector<int> ret(2, 0);
apply a vector: (size, initial value).
2. index starts from one (not zero).
3. small index comes first, big index comes next.
4. attention to the special condition: input one element in vector.
5. <Algorithm> library:
sort(nums.begin(), nums.end(), compare);
bool compare(const& T1, const& T2){return ...}
min, max;
6. data structure: map<int, int>. (all 0 in default)
*use multiply as key, then judge the sum.
*attention to multiply-numbers, use "long long" type.
7. Java data structure:
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
map.containsKey(num);
map.put(num, index);
index = map.get(num);