随笔分类 - Coding Made Simple
Lectures by Tushar Roy on Youtube.
摘要:Given a 2D matrix of integers, find maximum sum rectangle in this matrix. Brute force solution of enumerating all possible submatrix then check their
阅读全文
摘要: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
阅读全文
摘要:Given an array of length n that stores a stock's price in n consecutive days, Buy/Sell stock with at most K transactions to maximize profit. You must
阅读全文
摘要:Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including
阅读全文
摘要:Same Problem Link. [LintCode] Regular Expression Matching
阅读全文
摘要:Same Problem Link. [LintCode] Wildcard Matching
阅读全文
摘要:N pots, each with some number of gold coins, are arranged in a line. You are playing a game against another player. You take turns picking a pot of go
阅读全文
摘要: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.
阅读全文
摘要:Given a 2 dimensional matrix, find minimum cost path to reach bottom right from top left provided you can only from down and right. For a 5 * 5 matrix
阅读全文
摘要: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 a sequence of words, and a limit on the number of characters that can be put in one line(line width). Put line breaks in the given sequence such
阅读全文
摘要:Given boxes of different dimensions, stack them on top of each other to get maximum height such that box on top has strictly less length and width tha
阅读全文
摘要:Given an array, find maximum sum increasing subsequence in this array. Solution 1. Recursion For arr[0....n], the max sum increasing subsequence can b
阅读全文
摘要:Given a string, find longest palindromic subsequence in this string. lps[start, end] = lps[start + 1, end - 1] + 2, if s.charAt(start) == s.charAt(end
阅读全文
摘要:Given an array, find the longest increasing subsequence in this array. The same problem link. [LintCode] Longest Increasing Subsequence Related Proble
阅读全文
摘要:Given an array, find minimum number to jumps to reach end of array, given you can jump at max as much as value at position in array. The 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
阅读全文
摘要:Given a matrix of 0s and 1s. Find biggest sub-square matrix entirely of 1s in this matrix. The same problem link is as follows. Maximal Square
阅读全文