摘要:
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example: 阅读全文
摘要:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinctnumbers from the original list. Example 1: Example 2: 阅读全文
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 阅读全文
摘要:
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). Y 阅读全文
摘要:
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra 阅读全文
摘要:
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace 阅读全文
摘要:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: 阅读全文
摘要:
前几天打算一直想找一个时间把字符串匹配算认真弄一下,今天不想看其他的东西,那就想着把字符串匹配算法好好整理梳理一下。 字符串匹配算法有几种相对比较出名的,分别是BF(暴力破解),RK()、BM()、KMP()。下文中 主串为被匹配的串, 模式串为匹配的串。 例如 s = “aabbcc”(主串),a 阅读全文
摘要:
Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.You have the following 3 operations permitte 阅读全文
摘要:
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Input: [ [1,1,1], [1,0,1], [1,1,1] ] Output: 阅读全文