## 872 Leaf-Similar Trees左相似的树

Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.

For example, in the given tree above, the `leaf value sequence` is `(6, 7, 4, 9, 8)`.

Two binary trees are considered leaf-similar if their leaf value sequence is the same.

Return true `if` and `only if` the two given trees with head nodes `root1` and `root2` are `leaf-similar`.

## 874Walking Robot Simulation 模拟机器人行走路线

A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands:

```````-2`: turn left 90 degrees
`-1`: turn right 90 degrees
`1 <= x <= 9`: move forward x units
``````

Some of the grid squares are obstacles.

The `i-th` obstacle is at grid point (`obstacles[i][0]`, obstacles[i][1])

If the robot would try to move onto them, the robot stays on the previous grid square instead (but still continues following the rest of the route.)

Return the square of the maximum Euclidean distance that the robot will be from the origin.

• -1 右旋转90度路线
• -2 左旋转90度路线
• 1-9 就按照机器人方向行走
但是在遇到障碍物的时候，立即停止，直到下一个可执行的command到来。最后求，机器人所能到达的最远的 `max = i * i + j * j`

## 875. Koko Eating Bananas 珂珂吃香蕉

Koko loves to eat bananas. There are `N` piles of bananas, the `i-th` pile has `piles[i]` bananas. The guards have gone and will come back in `H`hours.

Koko can decide her bananas-per-hour eating speed of `K`. Each hour, she chooses some pile of bananas, and eats `K` bananas from that pile. If the pile has less than `K` bananas, she eats all of them instead, and won’t eat any more bananas during this hour.

Koko likes to eat `slowly`, but still wants to finish eating all the bananas before the guards come back.

Return the `minimum integer K`such that she can eat all the bananas within `H` hours.

## 873. Length of Longest Fibonacci Subsequence 最长的fib序列

A sequence `X_1, X_2, ..., X_n`is fibonacci-like if:
`n >= 3`
`X_i + X_{i+1} = X_{i+2} for all i + 2 <= n`

Given a strictly increasing array A of positive integers forming a sequence, find the length of the longest fibonacci-like subsequence of A. If one does not exist, return 0.

(Recall that a subsequence is derived from another sequence A by deleting any number of elements (including none) from A, without changing the order of the remaining elements. For example, [3, 5, 8] is a subsequence of `[3, 4, 5, 6, 7, 8]`.)

Example 1:

Input: `[1,2,3,4,5,6,7,8]`
Output:`5`
Explanation:
The longest subsequence that is fibonacci-like: `[1,2,3,5,8].`

Example 2:

Input: `[1,3,7,11,12,14,18]`
Output: `3`
Explanation:
The longest subsequence that is fibonacci-like:
`[1,11,12]`, `[3,11,14]` or`[7,11,18].`

simple brute force喽

`Java Code`