随笔分类 -  Google

摘要:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise). You are given an n x n 2D matrix representing an im 阅读全文
posted @ 2016-07-19 07:29 北叶青藤 阅读(199) 评论(0) 推荐(0)
摘要:Given n and k, return the k-th permutation sequence. Notice n will be between 1 and 9 inclusive. Given n and k, return the k-th permutation sequence. 阅读全文
posted @ 2016-07-18 12:57 北叶青藤 阅读(245) 评论(0) 推荐(0)
摘要:Spiral Matrix I Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. Example Given n = 3, You should retur 阅读全文
posted @ 2016-07-18 11:44 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Word Ladder I Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Onl 阅读全文
posted @ 2016-07-18 07:03 北叶青藤 阅读(368) 评论(0) 推荐(0)
摘要:Find Minimum in Rotated Sorted Array I Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 阅读全文
posted @ 2016-07-17 22:15 北叶青藤 阅读(181) 评论(0) 推荐(0)
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2016-07-17 20:10 北叶青藤 阅读(179) 评论(0) 推荐(0)
摘要:Given an absolute path for a file (Unix-style), simplify it. Have you met this question in a real interview? Yes Example "/home/", => "/home" "/a/./b/ 阅读全文
posted @ 2016-07-17 01:02 北叶青藤 阅读(218) 评论(0) 推荐(0)
摘要:Integer to Roman Given an integer, convert it to a roman numeral. The number is guaranteed to be within the range from 1 to 3999. Integer to Roman Giv 阅读全文
posted @ 2016-07-16 23:04 北叶青藤 阅读(232) 评论(0) 推荐(0)
摘要:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
posted @ 2016-07-16 11:21 北叶青藤 阅读(199) 评论(0) 推荐(0)
摘要:Given a string source and a string target, find the minimum window in source which will contain all the characters in target. Notice If there is no su 阅读全文
posted @ 2016-07-16 05:04 北叶青藤 阅读(385) 评论(0) 推荐(0)
摘要:Add Two Numbers I You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, 阅读全文
posted @ 2016-07-16 00:11 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Have you met this question in a real interview? Yes Exam 阅读全文
posted @ 2016-07-15 23:22 北叶青藤 阅读(187) 评论(0) 推荐(0)
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
posted @ 2016-07-15 22:48 北叶青藤 阅读(380) 评论(0) 推荐(0)
摘要:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 阅读全文
posted @ 2016-07-15 12:57 北叶青藤 阅读(190) 评论(0) 推荐(0)
摘要:Next Permutation Given a list of integers, which denote a permutation. Find the next permutation in ascending order. Notice The list may contains dupl 阅读全文
posted @ 2016-07-15 11:52 北叶青藤 阅读(275) 评论(0) 推荐(0)
摘要:Given string A representative a positive integer which has N digits, remove any k digits of the number, the remaining digits are arranged according to 阅读全文
posted @ 2016-07-15 05:15 北叶青藤 阅读(169) 评论(0) 推荐(0)
摘要:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文
posted @ 2016-07-14 21:58 北叶青藤 阅读(149) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2016-07-14 09:02 北叶青藤 阅读(242) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文
posted @ 2016-07-14 08:50 北叶青藤 阅读(158) 评论(0) 推荐(0)
摘要:Insert Intervals Given a non-overlapping interval list which is sorted by start point. Insert a new interval into it, make sure the list is still in o 阅读全文
posted @ 2016-07-14 03:57 北叶青藤 阅读(266) 评论(0) 推荐(0)