随笔分类 -  Leetcode

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.Analyse: For each row, we can det... 阅读全文
posted @ 2015-08-23 00:57 amazingzoe 阅读(119) 评论(0) 推荐(0)
摘要:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-08-22 13:40 amazingzoe 阅读(124) 评论(0) 推荐(0)
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
posted @ 2015-08-22 06:37 amazingzoe 阅读(153) 评论(0) 推荐(0)
摘要:Write a program to find then-th ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For example,1, 2, 3, 4, 5, 6, 8... 阅读全文
posted @ 2015-08-22 05:48 amazingzoe 阅读(250) 评论(0) 推荐(0)
摘要:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp... 阅读全文
posted @ 2015-08-21 09:51 amazingzoe 阅读(139) 评论(0) 推荐(0)
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-08-21 07:19 amazingzoe 阅读(147) 评论(0) 推荐(0)
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-08-20 06:04 amazingzoe 阅读(139) 评论(0) 推荐(0)
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2015-08-20 03:33 amazingzoe 阅读(121) 评论(0) 推荐(0)
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-08-19 20:00 amazingzoe 阅读(111) 评论(0) 推荐(0)
摘要:Note:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that h... 阅读全文
posted @ 2015-08-19 19:23 amazingzoe 阅读(126) 评论(0) 推荐(0)
摘要:Given an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennums[i]andnums[j]is at mo... 阅读全文
posted @ 2015-08-19 03:43 amazingzoe 阅读(153) 评论(0) 推荐(0)
摘要:Given an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the differe... 阅读全文
posted @ 2015-08-19 02:43 amazingzoe 阅读(144) 评论(0) 推荐(0)
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-08-19 00:51 amazingzoe 阅读(210) 评论(0) 推荐(0)
摘要:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-08-19 00:47 amazingzoe 阅读(197) 评论(0) 推荐(0)
摘要:Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regu... 阅读全文
posted @ 2015-08-18 23:02 amazingzoe 阅读(169) 评论(0) 推荐(0)
摘要:Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.Analyse: For each nod... 阅读全文
posted @ 2015-08-18 07:05 amazingzoe 阅读(260) 评论(0) 推荐(0)
摘要:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o... 阅读全文
posted @ 2015-08-18 03:50 amazingzoe 阅读(119) 评论(0) 推荐(0)
摘要:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()... 阅读全文
posted @ 2015-08-18 03:11 amazingzoe 阅读(135) 评论(0) 推荐(0)
摘要:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].Analyse: First... 阅读全文
posted @ 2015-08-10 18:55 amazingzoe 阅读(128) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2015-08-03 14:21 amazingzoe 阅读(180) 评论(0) 推荐(0)

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页