随笔分类 -  Array

上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: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)
摘要:The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the fo 阅读全文
posted @ 2016-07-16 05:12 北叶青藤 阅读(184) 评论(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)
摘要: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)
摘要:Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more than k pieces with the s 阅读全文
posted @ 2016-07-15 03:39 北叶青藤 阅读(248) 评论(0) 推荐(0)
摘要:There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
posted @ 2016-07-15 02:06 北叶青藤 阅读(280) 评论(0) 推荐(0)
摘要:Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each 阅读全文
posted @ 2016-07-14 21:35 北叶青藤 阅读(231) 评论(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 北叶青藤 阅读(241) 评论(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)
摘要:Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each 阅读全文
posted @ 2016-07-14 04:26 北叶青藤 阅读(250) 评论(0) 推荐(0)
摘要:Find the kth smallest number in at row and column sorted matrix. Example Given k = 4 and a matrix: [ [1 ,5 ,7], [3 ,7 ,8], [4 ,8 ,9], ] return 5. 分析: 阅读全文
posted @ 2016-07-14 02:29 北叶青藤 阅读(308) 评论(0) 推荐(0)
摘要:Determine whether a Sudoku is valid. The Sudoku board could be partially filled, where empty cells are filled with the character .. Notice A valid Sud 阅读全文
posted @ 2016-07-13 12:02 北叶青藤 阅读(209) 评论(0) 推荐(0)
摘要:Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we co 阅读全文
posted @ 2016-07-13 10:39 北叶青藤 阅读(234) 评论(0) 推荐(0)
摘要:Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Notice Please complete the problem in-place. 阅读全文
posted @ 2016-07-12 23:56 北叶青藤 阅读(281) 评论(0) 推荐(0)
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example Given n = 12, retu 阅读全文
posted @ 2016-07-12 02:04 北叶青藤 阅读(249) 评论(0) 推荐(0)
摘要:House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain 阅读全文
posted @ 2016-07-12 00:26 北叶青藤 阅读(231) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Notice You must 阅读全文
posted @ 2016-07-11 21:39 北叶青藤 阅读(174) 评论(0) 推荐(0)
摘要:Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文
posted @ 2016-07-10 23:04 北叶青藤 阅读(239) 评论(0) 推荐(0)
摘要:Given two array of integers(the first array is array A, the second array is arrayB), now we are going to find a element in array A which is A[i], and 阅读全文
posted @ 2016-07-10 12:45 北叶青藤 阅读(329) 评论(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. Notice Bonus point if you 阅读全文
posted @ 2016-07-10 08:46 北叶青藤 阅读(204) 评论(0) 推荐(0)

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