search similar people的API

nested array，etc [[1,2], 2, [[3], [4]]]，input是nested array的iterator，实现next element的iterator

design，tiny url

``````/**
* Find threevalues that can be the lengths of the sides of a triangle.
* Three segmentsof lengths A, B, C can form a triangle if and only if:
*
*      A + B > C
*      B + C > A
*      A + C > B
*
* e.g.
*  6, 4, 5 can form a triangle
* 10, 2, 7 can't
*
* @paramsegmentLengths the lengths of segments that might form a triangle.
* @return threevalues that can be the lengths of the sides of a triangle,
*         or an empty array if there are no suchvalues in segmentLengths.
* sample input:segmentLengths = [10, 5, 7, 4, 3]
*/
``````

Find the size of longest palindrome subset of an array

TODO

Deepest comman ancestor (with parent nodes).

Class Node {
Node left;
Node right;
Node parent;
}
root节点parent是null. 没有parent的做法的确是递归，但是有parent指针的话递归就划不来了。举个例子：

``````    ____3___
/        \
5          1
/    \     /    \
6     2   0      8
/ \
7   4
``````

• 两个没有环，不想交
• 两个没有环，相交
• 两个有环，不想交
• 两个有环，相交

Given the list {1,{4,{6}}} the function should return 17 (one 1 at weight 3, one 4 at depth 2, and one 6 at depth 1).先得走通一遍得到层数，然后对应上乘出来才可以得到结果.