JuneEnd

Thursday, November 3, 2016

419. Battleships in a Board

›
The key to solve this problem is the following two conditions: - Battleships can only be placed horizontally or vertically. In other words...
Wednesday, October 12, 2016

403. Frog Jump

›
In first place, the solution can be done by recursion and is very straightforward. The tricky part is in line 9 because when gap is less tha...

410. Split Array Largest Sum

›
I don't have clue in the first place, so I followed the top rated solution. The idea is the minimized maximum sum among the subarrays m...
Monday, October 10, 2016

404. Sum of Left Leaves

›
Well, very straightforward solution. 1: /** 2: * Definition for a binary tree node. 3: * struct TreeNode { 4: * int val; ...
Sunday, October 9, 2016

402. Remove K Digits

›
I was thinking the K digits must be consecutive but it turns out it's not necessary. So the problem becomes easier. All I need to do is ...

417. Pacific Atlantic Water Flow

›
We should start from the boundary of the matrix to see if they can reach the other ocean. So it is a typical DSF problem. For DSF problem, w...

407. Trapping Rain Water II

›
I don't have any clue to solve the problem. I have to follow the top rated solution. The idea behind is (1) Use minimum heap to store t...
›
Home
View web version

About Me

JuneEnd
View my complete profile
Powered by Blogger.