摘要: You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of ston 阅读全文
posted @ 2019-01-28 20:54 JamieLiu 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2019-01-28 20:24 JamieLiu 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: 采用优先级队列PriorityQueue,当对象add到queue中时,它已经按照某 阅读全文
posted @ 2019-01-27 22:33 JamieLiu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2019-01-26 21:42 JamieLiu 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 还是用DP来递归,抓住回 阅读全文
posted @ 2019-01-26 20:52 JamieLiu 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Foll 阅读全文
posted @ 2019-01-25 21:43 JamieLiu 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which cou 阅读全文
posted @ 2019-01-25 20:32 JamieLiu 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No 阅读全文
posted @ 2019-01-24 22:29 JamieLiu 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2019-01-24 19:40 JamieLiu 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
posted @ 2019-01-23 21:39 JamieLiu 阅读(100) 评论(0) 推荐(0) 编辑