摘要: en an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or down. 阅读全文
posted @ 2018-01-13 19:14 chenhan233 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2018-01-13 19:12 chenhan233 阅读(100) 评论(0) 推荐(0) 编辑
摘要: There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Your job is to fence the entire garden using the 阅读全文
posted @ 2018-01-13 19:11 chenhan233 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Follow up:Wha 阅读全文
posted @ 2018-01-13 19:10 chenhan233 阅读(94) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2018-01-13 19:07 chenhan233 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2018-01-13 19:06 chenhan233 阅读(96) 评论(0) 推荐(0) 编辑
摘要: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t 阅读全文
posted @ 2018-01-13 19:04 chenhan233 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could 阅读全文
posted @ 2018-01-13 19:02 chenhan233 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 \ 3 / 2 O 阅读全文
posted @ 2018-01-13 19:01 chenhan233 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given 阅读全文
posted @ 2018-01-13 18:59 chenhan233 阅读(93) 评论(0) 推荐(0) 编辑