随笔分类 - LintCode
摘要:Given a list of numbers with duplicate number in it. Find all unique permutations. Have you met this question in a real interview? Yes Given a list of
阅读全文
摘要:Given a list of numbers, return all possible permutations. You can assume that there is no duplicate numbers in the list. Given a list of numbers, ret
阅读全文
摘要:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O''s into 'X''s in that surround
阅读全文
摘要:A non-negative numbers can be regarded as product of its factors.Write a function that takes an integer n and return all possible combinations of its
阅读全文
摘要:You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an obstacle.0 - A gate.INF - Infinity means an empty room.
阅读全文
摘要: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 of a nut to ano
阅读全文
摘要: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
阅读全文
摘要:Calculate the (a^n) % b where a, b and n are all 32bit integers. Calculate the (a^n) % b where a, b and n are all 32bit integers. Calculate the (a^n)
阅读全文
摘要:Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1
阅读全文
摘要:Given a binary search tree (See Definition) and a node in it, find the in-order successor of that node in the BST. If the given node has no in-order s
阅读全文
摘要:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up
阅读全文
摘要:Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Have you met thi
阅读全文
摘要:Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam
阅读全文
摘要:Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all
阅读全文
摘要:Given a 2D matrix of 0s and 1s, find maximum size rectangle of all 1s in this matrix. Brute force solution is very inefficient. A better solution is t
阅读全文
摘要:You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. A pair (c, d) can follow another pair (a,
阅读全文
摘要:Same Problem Link. [LintCode] Regular Expression Matching
阅读全文
摘要:Same Problem Link. [LintCode] Wildcard Matching
阅读全文
摘要:Given a string s, cut s into some substrings such that every substring is a palindrome. Return the minimum cuts needed for a palindrome partitioning o
阅读全文
摘要:Given a string and a dictionary, return true if the string can be split into multiple words such that each word is in dictionary. If not return false.
阅读全文

浙公网安备 33010602011771号