随笔分类 -  LeetCode

上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 61 下一页
摘要:Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha 阅读全文
posted @ 2017-07-10 06:53 Grandyang 阅读(8853) 评论(2) 推荐(1)
摘要:Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have 阅读全文
posted @ 2017-07-10 06:48 Grandyang 阅读(8665) 评论(0) 推荐(1)
摘要:There are n different online courses numbered from 1 to n. Each course has some duration(course length) tand closed on dth day. A course should be tak 阅读全文
posted @ 2017-07-06 14:44 Grandyang 阅读(8042) 评论(3) 推荐(2)
摘要:Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an in 阅读全文
posted @ 2017-07-03 15:33 Grandyang 阅读(6535) 评论(2) 推荐(1)
摘要: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 @ 2017-06-30 14:43 Grandyang 阅读(33657) 评论(16) 推荐(2)
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp 阅读全文
posted @ 2017-06-27 14:25 Grandyang 阅读(6692) 评论(2) 推荐(0)
摘要:Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i 阅读全文
posted @ 2017-06-25 05:27 Grandyang 阅读(4831) 评论(1) 推荐(0)
摘要:Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and cal 阅读全文
posted @ 2017-06-24 14:33 Grandyang 阅读(6223) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 阅读全文
posted @ 2017-06-23 15:35 Grandyang 阅读(4408) 评论(2) 推荐(0)
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文
posted @ 2017-06-21 12:18 Grandyang 阅读(11785) 评论(0) 推荐(0)
摘要:Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak 阅读全文
posted @ 2017-06-20 13:02 Grandyang 阅读(9964) 评论(3) 推荐(0)
摘要:Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If 阅读全文
posted @ 2017-06-18 07:02 Grandyang 阅读(11196) 评论(2) 推荐(0)
摘要:Design and implement a data structure for a compressed string iterator. It should support the following operations: next and hasNext. The given compre 阅读全文
posted @ 2017-06-16 13:14 Grandyang 阅读(4937) 评论(0) 推荐(0)
摘要:Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is 阅读全文
posted @ 2017-06-15 11:13 Grandyang 阅读(4104) 评论(2) 推荐(0)
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2017-06-14 11:35 Grandyang 阅读(5302) 评论(0) 推荐(1)
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2017-06-13 11:01 Grandyang 阅读(5449) 评论(2) 推荐(0)
摘要:Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
posted @ 2017-06-11 03:55 Grandyang 阅读(8820) 评论(1) 推荐(0)
摘要:Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2017-06-10 14:19 Grandyang 阅读(4675) 评论(0) 推荐(0)
摘要:Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is repres 阅读全文
posted @ 2017-06-09 23:42 Grandyang 阅读(4158) 评论(0) 推荐(0)
摘要:Given a positive integer n, find the number of non-negative integers less than or equal to n, whose binary representations do NOT contain consecutive 阅读全文
posted @ 2017-06-07 23:14 Grandyang 阅读(5552) 评论(0) 推荐(0)

上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 61 下一页
Fork me on GitHub