随笔分类 -  Leetcode

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页
摘要:For some fixed N, an array A is beautiful if it is a permutation of the integers 1, 2, ..., N, such that: For every i < j, there is no k with i < k < 阅读全文
posted @ 2019-01-31 22:37 Veritas_des_Liberty 阅读(247) 评论(0) 推荐(0) 编辑
摘要:We are given S, a length n string of characters from the set {'D', 'I'}. (These letters stand for "decreasing" and "increasing".) A valid permutation  阅读全文
posted @ 2019-01-30 23:43 Veritas_des_Liberty 阅读(376) 评论(0) 推荐(0) 编辑
摘要:In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to s 阅读全文
posted @ 2019-01-30 23:04 Veritas_des_Liberty 阅读(353) 评论(0) 推荐(0) 编辑
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2019-01-30 22:09 Veritas_des_Liberty 阅读(160) 评论(0) 推荐(0) 编辑
摘要:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th 阅读全文
posted @ 2019-01-28 19:23 Veritas_des_Liberty 阅读(162) 评论(0) 推荐(0) 编辑
摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d 阅读全文
posted @ 2019-01-28 18:27 Veritas_des_Liberty 阅读(145) 评论(0) 推荐(0) 编辑
摘要:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2019-01-28 18:23 Veritas_des_Liberty 阅读(181) 评论(0) 推荐(0) 编辑
摘要:984. String Without AAA or BBB Given two integers A and B, return any string S such that: S has length A + B and contains exactly A 'a' letters, and e 阅读全文
posted @ 2019-01-27 13:21 Veritas_des_Liberty 阅读(257) 评论(0) 推荐(0) 编辑
摘要:Given an array A of 0s and 1s, divide the array into 3 non-empty parts such that all of these parts represent the same binary value. If it is possible 阅读全文
posted @ 2019-01-26 21:26 Veritas_des_Liberty 阅读(259) 评论(0) 推荐(0) 编辑
摘要:Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and add x to A[i] (only once). After this process, we ha 阅读全文
posted @ 2019-01-26 21:18 Veritas_des_Liberty 阅读(240) 评论(0) 推荐(0) 编辑
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren 阅读全文
posted @ 2019-01-26 21:16 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑
摘要:You want to form a target string of lowercase letters. At the beginning, your sequence is target.length '?' marks. You also have a stamp of lowercase 阅读全文
posted @ 2019-01-24 12:42 Veritas_des_Liberty 阅读(277) 评论(0) 推荐(0) 编辑
摘要:The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat carries at most 2 people at the same time, provided 阅读全文
posted @ 2019-01-24 11:29 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑
摘要:Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]. Return any permutation 阅读全文
posted @ 2019-01-23 22:56 Veritas_des_Liberty 阅读(207) 评论(0) 推荐(0) 编辑
摘要:A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands: -2: turn left 90 de 阅读全文
posted @ 2019-01-23 22:55 Veritas_des_Liberty 阅读(277) 评论(0) 推荐(0) 编辑
摘要:We have a two dimensional matrix A where each value is 0 or 1. A move consists of choosing any row or column, and toggling each value in that row or c 阅读全文
posted @ 2019-01-22 20:19 Veritas_des_Liberty 阅读(183) 评论(0) 推荐(0) 编辑
摘要:At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bil 阅读全文
posted @ 2019-01-22 19:18 Veritas_des_Liberty 阅读(203) 评论(0) 推荐(0) 编辑
摘要:Given a string S of digits, such as S = "123456579", we can split it into a Fibonacci-like sequence [123, 456, 579]. Formally, a Fibonacci-like sequen 阅读全文
posted @ 2019-01-22 19:01 Veritas_des_Liberty 阅读(331) 评论(0) 推荐(0) 编辑
摘要:N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side b 阅读全文
posted @ 2019-01-22 17:57 Veritas_des_Liberty 阅读(299) 评论(0) 推荐(0) 编辑
摘要:A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one p 阅读全文
posted @ 2019-01-10 20:55 Veritas_des_Liberty 阅读(261) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页