摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: 用dp。二重循环,如果dp[i][j]=1,检查一下 阅读全文
posted @ 2018-11-29 16:37 fatttcat 阅读(106) 评论(0) 推荐(0)
摘要: Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l 阅读全文
posted @ 2018-11-29 13:02 fatttcat 阅读(127) 评论(0) 推荐(0)
摘要: Given two 1d vectors, implement an iterator to return their elements alternately. Example: Follow up: What if you are given k 1d vectors? How well can 阅读全文
posted @ 2018-11-29 12:09 fatttcat 阅读(119) 评论(0) 推荐(0)
摘要: A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return 阅读全文
posted @ 2018-11-29 05:29 fatttcat 阅读(130) 评论(0) 推荐(0)
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2018-11-26 17:53 fatttcat 阅读(119) 评论(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 to 阅读全文
posted @ 2018-11-26 17:36 fatttcat 阅读(136) 评论(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 to 阅读全文
posted @ 2018-11-26 16:54 fatttcat 阅读(207) 评论(0) 推荐(0)
摘要: Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2018-11-26 04:15 fatttcat 阅读(134) 评论(0) 推荐(0)
摘要: Given an array of strings, group anagrams together. Example: Note: All inputs will be in lowercase. The order of your output does not matter. 判断anagra 阅读全文
posted @ 2018-11-25 19:28 fatttcat 阅读(122) 评论(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-11-25 19:17 fatttcat 阅读(106) 评论(0) 推荐(0)