随笔分类 -  LeetCode

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 61 下一页
摘要:From any string, we can form a subsequence of that string by deleting some number of characters (possibly no deletions). Given two strings source and  阅读全文
posted @ 2021-03-28 12:18 Grandyang 阅读(1475) 评论(0) 推荐(0)
摘要:Return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. Note: This question is the same as 阅读全文
posted @ 2021-03-28 12:07 Grandyang 阅读(706) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.) A node is insu 阅读全文
posted @ 2021-03-28 12:05 Grandyang 阅读(433) 评论(0) 推荐(0)
摘要:You have n tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty sequences of letters you can make usi 阅读全文
posted @ 2021-03-28 12:04 Grandyang 阅读(729) 评论(0) 推荐(0)
摘要:Given words first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and thir 阅读全文
posted @ 2021-03-28 12:01 Grandyang 阅读(329) 评论(0) 推荐(0)
摘要:Given a matrix and a target, return the number of non-empty submatrices that sum to target. A submatrix x1, y1, x2, y2 is the set of all cells matrix[ 阅读全文
posted @ 2021-03-28 11:59 Grandyang 阅读(1375) 评论(0) 推荐(0)
摘要:Given two numbers arr1 and arr2 in base -2, return the result of adding them together. Each number is given in array format: as an array of 0s and 1s, 阅读全文
posted @ 2021-03-28 11:57 Grandyang 阅读(544) 评论(0) 推荐(0)
摘要:You are given an binary matrix . You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the 阅读全文
posted @ 2021-03-16 15:52 Grandyang 阅读(651) 评论(3) 推荐(0)
摘要:For two strings and , we say " divides " if and only if ( concatenated with itself 1 or more times) Given two strings str1 and str2, return the larges 阅读全文
posted @ 2021-03-15 14:08 Grandyang 阅读(2065) 评论(0) 推荐(0)
摘要:In a warehouse, there is a row of barcodes, where the barcode is . Rearrange the barcodes so that no two adjacent barcodes are equal. You may return a 阅读全文
posted @ 2021-03-13 16:24 Grandyang 阅读(479) 评论(0) 推荐(0)
摘要:Given an array of positive integers (not necessarily distinct), return the lexicographically largest permutation that is smaller than , that can be ma 阅读全文
posted @ 2021-03-12 14:13 Grandyang 阅读(626) 评论(0) 推荐(0)
摘要:Today, the bookstore owner has a store open for minutes. Every minute, some number of customers ( ) enter the store, and all those customers leave aft 阅读全文
posted @ 2021-03-09 17:19 Grandyang 阅读(697) 评论(1) 推荐(0)
摘要:Given a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap. Return any 阅读全文
posted @ 2021-03-08 07:13 Grandyang 阅读(2228) 评论(1) 推荐(1)
摘要:Students are asked to stand in non decreasing order of heights for an annual photo. Return the minimum number of students that must move in order for 阅读全文
posted @ 2021-03-05 13:34 Grandyang 阅读(540) 评论(0) 推荐(0)
摘要:You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choo 阅读全文
posted @ 2021-03-04 15:15 Grandyang 阅读(1917) 评论(1) 推荐(1)
摘要:Given a list of words, each word consists of English lowercase letters. Let's say is a predecessor of if and only if we can add exactly one letter any 阅读全文
posted @ 2021-03-03 13:49 Grandyang 阅读(2185) 评论(0) 推荐(0)
摘要:Given a string of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make du 阅读全文
posted @ 2021-03-02 11:52 Grandyang 阅读(1343) 评论(0) 推荐(0)
摘要:We have a collection of stones, each stone has a positive integer weight. Each turn, we choose the two heaviest stones and smash them together. Suppos 阅读全文
posted @ 2021-03-01 12:31 Grandyang 阅读(1304) 评论(0) 推荐(0)
摘要:Given an integer array , you should partition the array into (contiguous) subarrays of length at most . After partitioning, each subarray has their va 阅读全文
posted @ 2021-03-01 08:51 Grandyang 阅读(1228) 评论(1) 推荐(0)
摘要:You have gardens, labeled from to , and an array where describes a bidirectional path between garden to garden . In each garden, you want to plant one 阅读全文
posted @ 2021-02-27 15:32 Grandyang 阅读(763) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 61 下一页
Fork me on GitHub