随笔分类 -  LeetCode

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 61 下一页
摘要:Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted by frequency from highest to lowest. If two words h 阅读全文
posted @ 2017-10-18 23:52 Grandyang 阅读(12746) 评论(8) 推荐(0) 编辑
摘要:Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element 阅读全文
posted @ 2017-10-16 21:42 Grandyang 阅读(6053) 评论(0) 推荐(0) 编辑
摘要:You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that a 阅读全文
posted @ 2017-10-14 23:47 Grandyang 阅读(16027) 评论(4) 推荐(1) 编辑
摘要:There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison 阅读全文
posted @ 2017-10-13 23:45 Grandyang 阅读(6842) 评论(0) 推荐(0) 编辑
摘要:You are given a circular array nums of positive and negative integers. If a number k at an index is positive, then move forward k steps. Conversely, i 阅读全文
posted @ 2017-10-12 21:09 Grandyang 阅读(10283) 评论(11) 推荐(0) 编辑
摘要:A gene string can be represented by an 8-character long string, with choices from "A", "C", "G", "T". Suppose we need to investigate about a mutation 阅读全文
posted @ 2017-10-11 21:40 Grandyang 阅读(4562) 评论(2) 推荐(0) 编辑
摘要:Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be ve 阅读全文
posted @ 2017-10-10 11:32 Grandyang 阅读(4841) 评论(1) 推荐(0) 编辑
摘要:You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id. 阅读全文
posted @ 2017-10-09 10:06 Grandyang 阅读(3964) 评论(3) 推荐(0) 编辑
摘要:On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the 阅读全文
posted @ 2017-10-08 23:29 Grandyang 阅读(7546) 评论(2) 推荐(0) 编辑
摘要:Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2017-10-07 23:51 Grandyang 阅读(10754) 评论(5) 推荐(0) 编辑
摘要:Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2017-10-06 13:21 Grandyang 阅读(9580) 评论(2) 推荐(0) 编辑
摘要:In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (wi 阅读全文
posted @ 2017-10-05 11:43 Grandyang 阅读(12531) 评论(3) 推荐(1) 编辑
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2017-10-04 22:17 Grandyang 阅读(3582) 评论(0) 推荐(0) 编辑
摘要:Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit 阅读全文
posted @ 2017-10-03 13:03 Grandyang 阅读(9184) 评论(2) 推荐(0) 编辑
摘要:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: Note: 这道题是之前那道Vali 阅读全文
posted @ 2017-10-02 08:17 Grandyang 阅读(10345) 评论(1) 推荐(0) 编辑
摘要:Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the vali 阅读全文
posted @ 2017-10-01 12:40 Grandyang 阅读(10744) 评论(3) 推荐(1) 编辑
摘要:Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents the k 阅读全文
posted @ 2017-09-30 23:54 Grandyang 阅读(4027) 评论(3) 推荐(0) 编辑
摘要:Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list of non-repetitive words to build a di 阅读全文
posted @ 2017-09-29 21:52 Grandyang 阅读(4671) 评论(1) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-09-28 22:30 Grandyang 阅读(5049) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two l 阅读全文
posted @ 2017-09-27 21:06 Grandyang 阅读(10372) 评论(3) 推荐(1) 编辑

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 61 下一页
Fork me on GitHub