随笔分类 -  LeetCode

上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 61 下一页
摘要: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 阅读(6566) 评论(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 阅读(4759) 评论(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 阅读(6144) 评论(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 阅读(4363) 评论(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 阅读(11688) 评论(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 阅读(9802) 评论(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 阅读(11103) 评论(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 阅读(4878) 评论(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 阅读(4040) 评论(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 阅读(5202) 评论(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 阅读(5398) 评论(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 阅读(8617) 评论(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 阅读(4598) 评论(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 阅读(4095) 评论(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 阅读(5431) 评论(0) 推荐(0) 编辑
摘要:Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final 阅读全文
posted @ 2017-06-06 23:30 Grandyang 阅读(4105) 评论(0) 推荐(0) 编辑
摘要:Design an in-memory file system to simulate the following functions: ls: Given a path in string format. If it is a file path, return a list that only 阅读全文
posted @ 2017-06-05 12:32 Grandyang 阅读(13733) 评论(1) 推荐(0) 编辑
摘要:You are given an integer array nums of length n where nums is a permutation of the numbers in the range [0, n - 1]. You should build a set s[k] = {num 阅读全文
posted @ 2017-06-02 12:45 Grandyang 阅读(6343) 评论(16) 推荐(0) 编辑
摘要:There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary i 阅读全文
posted @ 2017-06-01 11:14 Grandyang 阅读(7378) 评论(5) 推荐(0) 编辑
摘要:There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the s 阅读全文
posted @ 2017-05-30 10:52 Grandyang 阅读(3399) 评论(0) 推荐(0) 编辑

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