随笔分类 -  leetcode && lintcode

摘要:Description: Given an array with integers. Find two non overlapping subarrays A and B, which |SUM(A) SUM(B)| is the largest . Return the largest di... 阅读全文
posted @ 2015-10-16 03:08 影湛 阅读(160) 评论(0) 推荐(0)
摘要:Description: Given n x m non negative integers representing an elevation map 2d where the area of each cell is 1 x 1, compute how much water it is ab... 阅读全文
posted @ 2015-10-15 02:53 影湛 阅读(163) 评论(0) 推荐(0)
摘要:Description: 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 ... 阅读全文
posted @ 2015-10-15 01:45 影湛 阅读(115) 评论(0) 推荐(0)
摘要:Description: Given a string source and a string target, find the minimum window in source which will contain all the characters in target. Example s... 阅读全文
posted @ 2015-10-13 17:40 影湛 阅读(148) 评论(0) 推荐(0)
摘要:Description: Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the ... 阅读全文
posted @ 2015-10-12 02:20 影湛 阅读(146) 评论(0) 推荐(0)
摘要:Description: Numbers keep coming, return the median of numbers at every time a new number added. Example For numbers coming list: , return . For nu... 阅读全文
posted @ 2015-10-10 17:01 影湛 阅读(164) 评论(0) 推荐(0)
摘要:Description: Given an array of n integer, and a moving window(size k), move the window at each iteration from the start of the array, find the median... 阅读全文
posted @ 2015-10-10 16:25 影湛 阅读(192) 评论(0) 推荐(0)
摘要:Description: Given a matrix of lower alphabets and a dictionary. Find all words in the dictionary that can be found in the matrix. A word can start f... 阅读全文
posted @ 2015-09-30 05:41 影湛 阅读(147) 评论(0) 推荐(0)
摘要:Description: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains... 阅读全文
posted @ 2015-09-19 04:09 影湛 阅读(162) 评论(0) 推荐(0)
摘要:Description: Given an array of n objects with k different colors (numbered from 1 to k), sort them so that objects of the same color are adjacent, wi... 阅读全文
posted @ 2015-09-18 20:13 影湛 阅读(146) 评论(0) 推荐(0)
摘要:Description: Given a set of n nuts of different sizes and n bolts of different sizes. There is a one one mapping between nuts and bolts. Comparison o... 阅读全文
posted @ 2015-09-16 22:23 影湛 阅读(175) 评论(0) 推荐(0)
摘要:Description: Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Example For... 阅读全文
posted @ 2015-09-15 17:49 影湛 阅读(199) 评论(0) 推荐(0)
摘要:Description: Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array. Find i... 阅读全文
posted @ 2015-09-15 15:30 影湛 阅读(130) 评论(0) 推荐(0)
摘要:Description: Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array. Find i... 阅读全文
posted @ 2015-09-15 04:44 影湛 阅读(103) 评论(0) 推荐(0)
摘要:Description: There is an integer matrix which has the following features: The numbers in adjacent positions are different. The matrix has n rows and... 阅读全文
posted @ 2015-09-15 02:53 影湛 阅读(158) 评论(0) 推荐(0)
摘要:Description: Validate if a given string is numeric. Example "0" = true " 0.1 " = true "abc" = false "1 a" = false "2e10" = true Solution: class... 阅读全文
posted @ 2015-09-13 17:11 影湛 阅读(120) 评论(0) 推荐(0)
摘要:Description: 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 t... 阅读全文
posted @ 2015-09-13 16:44 影湛 阅读(101) 评论(0) 推荐(0)
摘要:Description: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 st... 阅读全文
posted @ 2015-09-13 04:13 影湛 阅读(106) 评论(0) 推荐(0)
摘要:Description: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. ... 阅读全文
posted @ 2015-09-13 03:23 影湛 阅读(103) 评论(0) 推荐(0)
摘要:Description: Given an integer array, find a continuous rotate subarray where the sum of numbers is the biggest. Your code should return the index of ... 阅读全文
posted @ 2015-09-11 20:42 影湛 阅读(125) 评论(0) 推荐(0)