随笔分类 -  LeetCode

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 61 下一页
摘要:On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally 阅读全文
posted @ 2018-04-26 23:31 Grandyang 阅读(8114) 评论(2) 推荐(0)
摘要:Given an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1] 阅读全文
posted @ 2018-04-24 23:22 Grandyang 阅读(5916) 评论(3) 推荐(0)
摘要:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone 阅读全文
posted @ 2018-04-22 23:37 Grandyang 阅读(4615) 评论(0) 推荐(0)
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2018-04-18 11:58 Grandyang 阅读(27427) 评论(11) 推荐(1)
摘要:This question is the same as "Max Chunks to Make Sorted" except the integers of the given array are not necessarily distinct, the input array could be 阅读全文
posted @ 2018-04-15 23:51 Grandyang 阅读(7362) 评论(2) 推荐(1)
摘要:Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and individuall 阅读全文
posted @ 2018-04-13 21:05 Grandyang 阅读(5465) 评论(1) 推荐(0)
摘要:Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output 阅读全文
posted @ 2018-04-11 23:40 Grandyang 阅读(12233) 评论(7) 推荐(0)
摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2018-04-08 05:38 Grandyang 阅读(11510) 评论(0) 推荐(1)
摘要:A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if the m 阅读全文
posted @ 2018-04-06 23:42 Grandyang 阅读(7536) 评论(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 @ 2018-04-04 12:31 Grandyang 阅读(6783) 评论(5) 推荐(2)
摘要:Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W. If there is no such window in S that covers al 阅读全文
posted @ 2018-03-31 23:54 Grandyang 阅读(15279) 评论(6) 推荐(1)
摘要:In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. What is the largest axis-alig 阅读全文
posted @ 2018-03-30 23:28 Grandyang 阅读(4703) 评论(0) 推荐(0)
摘要:Given a chemical formula (given as a string), return the count of each atom. The atomic element always starts with an uppercase character, then zero o 阅读全文
posted @ 2018-03-28 23:44 Grandyang 阅读(5327) 评论(3) 推荐(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 @ 2018-03-26 23:25 Grandyang 阅读(12365) 评论(1) 推荐(0)
摘要:Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation 阅读全文
posted @ 2018-03-24 23:55 Grandyang 阅读(4238) 评论(0) 推荐(1)
摘要:Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference bet 阅读全文
posted @ 2018-03-22 23:48 Grandyang 阅读(8581) 评论(6) 推荐(0)
摘要:Special binary strings are binary strings with the following two properties: The number of 0's is equal to the number of 1's. Every prefix of the bina 阅读全文
posted @ 2018-03-19 23:56 Grandyang 阅读(6419) 评论(2) 推荐(1)
摘要:A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner. addRan 阅读全文
posted @ 2018-03-16 23:53 Grandyang 阅读(5845) 评论(0) 推荐(0)
摘要:Given two lists A and B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A. We want to find 阅读全文
posted @ 2018-03-14 23:53 Grandyang 阅读(4284) 评论(0) 推荐(0)
摘要:We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, 阅读全文
posted @ 2018-03-12 22:49 Grandyang 阅读(9097) 评论(0) 推荐(0)

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 61 下一页
Fork me on GitHub