随笔分类 -  LintCode

摘要:Given a string, how many minimum splits would it take so that each partition after split is a palindrome. Same Problem Link [LintCode] Palindrome Part 阅读全文
posted @ 2017-08-26 04:56 Review->Improve 阅读(115) 评论(0) 推荐(0)
摘要:Given two strings and operations edit, delete and add, how many minimum operations would it take to convert one string to another string. Same Problem 阅读全文
posted @ 2017-08-26 03:02 Review->Improve 阅读(101) 评论(0) 推荐(0)
摘要:Given three strings, return true if third string is interleaving of first and second string. By running some examples, it seems that as long as s1.len 阅读全文
posted @ 2017-08-23 12:09 Review->Improve 阅读(241) 评论(0) 推荐(0)
摘要:Find Maximum Number that can be formed using all digits in the given integer. Solution 1. O(n * log n) runtime, O(n) space using sorting A simple solu 阅读全文
posted @ 2017-08-22 05:16 Review->Improve 阅读(381) 评论(0) 推荐(0)
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square which diagonal is all 1 and others is 0. Only consider the main diagonal sit 阅读全文
posted @ 2017-08-19 11:40 Review->Improve 阅读(794) 评论(0) 推荐(0)
摘要:Given two strings, find longest common substring between them. Solution 1. Brute force search, O(n^2 * m), O(1) memory Algorithm. O(n^2) runtime to fi 阅读全文
posted @ 2017-08-18 01:00 Review->Improve 阅读(293) 评论(0) 推荐(0)
摘要:Given a set of distinct integers, return all possible subsets. Notice Elements in a subset must be in non-descending order. The solution set must not 阅读全文
posted @ 2017-08-08 13:26 Review->Improve 阅读(251) 评论(0) 推荐(0)
摘要:Given a set of non negative integers and a target value, find if there exists a subset in the given set whose sum is target. Solution 1. Enumerate all 阅读全文
posted @ 2017-08-08 12:50 Review->Improve 阅读(527) 评论(0) 推荐(0)
摘要:Given two strings, find the longest common subsequence (LCS). Your code should return the length of LCS. Given two strings, find the longest common su 阅读全文
posted @ 2017-08-02 14:02 Review->Improve 阅读(191) 评论(0) 推荐(0)
摘要:A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmo 阅读全文
posted @ 2017-08-01 07:03 Review->Improve 阅读(820) 评论(0) 推荐(0)
摘要:Giving a string with number from 1 to n in random order, but miss 1 number.Find that number. You can assume n <= 30 Giving a string with number from 1 阅读全文
posted @ 2017-07-21 14:15 Review->Improve 阅读(862) 评论(0) 推荐(0)
摘要:Given an array contains N numbers of 0 .. N, find which number doesn't exist in the array. Given an array contains N numbers of 0 .. N, find which num 阅读全文
posted @ 2017-07-21 11:14 Review->Improve 阅读(576) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. Given an unsorted integer array, find the first missing positive integer. Gi 阅读全文
posted @ 2017-07-21 07:05 Review->Improve 阅读(466) 评论(8) 推荐(1)
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Given an unsorted array of integers, find the lengt 阅读全文
posted @ 2017-07-19 06:08 Review->Improve 阅读(191) 评论(0) 推荐(0)
摘要:Implement a load balancer for web servers. It provide the following functionality: Add a new server to the cluster => add(server_id). Remove a bad ser 阅读全文
posted @ 2017-07-19 04:27 Review->Improve 阅读(1012) 评论(0) 推荐(0)
摘要:Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. Given a sorted integer 阅读全文
posted @ 2017-07-19 01:05 Review->Improve 阅读(529) 评论(0) 推荐(0)
摘要:Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n 阅读全文
posted @ 2017-07-19 00:42 Review->Improve 阅读(334) 评论(0) 推荐(0)
摘要:Given an integer array, find a subarray where the sum of numbers is in a given interval. Your code should return the number of possible answers. (The 阅读全文
posted @ 2017-07-19 00:16 Review->Improve 阅读(816) 评论(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-07-18 07:18 Review->Improve 阅读(426) 评论(0) 推荐(0)
摘要:An abbreviation of a word follows the form . Below are some examples of word abbreviations: a) it --> it (no abbreviation) 1 b) d|o|g --> d1g 1 1 1 1 阅读全文
posted @ 2017-07-18 06:44 Review->Improve 阅读(530) 评论(0) 推荐(0)