随笔分类 -  Leetcode

上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2017-02-13 22:07 amazingzoe 阅读(186) 评论(0) 推荐(0)
摘要:Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2017-02-13 20:53 amazingzoe 阅读(145) 评论(0) 推荐(0)
摘要:Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 阅读全文
posted @ 2017-02-13 20:33 amazingzoe 阅读(217) 评论(0) 推荐(0)
摘要:Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2017-02-13 20:18 amazingzoe 阅读(557) 评论(0) 推荐(0)
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2017-02-13 19:14 amazingzoe 阅读(196) 评论(0) 推荐(0)
摘要:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a 阅读全文
posted @ 2017-02-12 20:44 amazingzoe 阅读(123) 评论(0) 推荐(0)
摘要:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2017-02-12 20:09 amazingzoe 阅读(99) 评论(0) 推荐(0)
摘要:Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given p 阅读全文
posted @ 2017-02-12 19:10 amazingzoe 阅读(299) 评论(0) 推荐(0)
摘要:Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
posted @ 2017-02-12 18:04 amazingzoe 阅读(166) 评论(0) 推荐(0)
摘要:Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio 阅读全文
posted @ 2017-02-12 17:49 amazingzoe 阅读(125) 评论(0) 推荐(0)
摘要:There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai 阅读全文
posted @ 2017-02-12 17:19 amazingzoe 阅读(176) 评论(0) 推荐(0)
摘要:For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now i 阅读全文
posted @ 2017-02-12 17:16 amazingzoe 阅读(327) 评论(0) 推荐(0)
摘要:Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2017-02-12 17:15 amazingzoe 阅读(494) 评论(0) 推荐(0)
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length 阅读全文
posted @ 2017-02-12 17:14 amazingzoe 阅读(142) 评论(0) 推荐(0)
摘要:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2017-02-12 17:13 amazingzoe 阅读(120) 评论(0) 推荐(0)
摘要:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given inte 阅读全文
posted @ 2017-02-12 17:09 amazingzoe 阅读(207) 评论(0) 推荐(0)
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-02-12 17:08 amazingzoe 阅读(512) 评论(0) 推荐(0)
摘要:Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2016-11-18 10:48 amazingzoe 阅读(138) 评论(0) 推荐(0)
摘要:Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation. A string such as "word" contains o 阅读全文
posted @ 2016-11-18 06:51 amazingzoe 阅读(212) 评论(0) 推荐(0)
摘要:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2016-11-18 06:14 amazingzoe 阅读(196) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页