Given a 2D board containing ‘X’ and ‘O’, capture all regions surrounded by ‘X’. A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region . The trick is to search from the edge, but not inside the whole region. These 4 images show how the trick works.
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. At first my thought was, given 2 points, we can get a line which connect these two points, and this line can be designated as: y = k x + b Assume one of the two points is … [Read more…]
I didn’t rest, I didn’t stop!!! At the beginning of next semester, me and my mates will attend both NYU and CMU career fairs, so we are preparing for it. I’ve just finished 150 problems @LeetCode, and I feel stronger than before. However, there are some sort of “knotty” problems that I can hardly solve … [Read more…]