随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given an unsorted integer array, find the first missing positive integer. Given an unsorted integer array, find the first missing positive integer. Gi
阅读全文
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Given an unsorted array of integers, find the lengt
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号