随笔分类 -  Leetcode

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页
摘要:Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyza 阅读全文
posted @ 2019-03-06 22:32 Veritas_des_Liberty 阅读(238) 评论(0) 推荐(0) 编辑
摘要:In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin 阅读全文
posted @ 2019-03-06 21:33 Veritas_des_Liberty 阅读(269) 评论(0) 推荐(0) 编辑
摘要:Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc". On the other hand, we define that stri 阅读全文
posted @ 2019-03-05 22:18 Veritas_des_Liberty 阅读(313) 评论(0) 推荐(0) 编辑
摘要:In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文
posted @ 2019-02-28 09:55 Veritas_des_Liberty 阅读(327) 评论(0) 推荐(0) 编辑
摘要:A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2019-02-28 08:59 Veritas_des_Liberty 阅读(271) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both 阅读全文
posted @ 2019-02-19 23:22 Veritas_des_Liberty 阅读(245) 评论(0) 推荐(0) 编辑
摘要:A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2019-02-19 22:56 Veritas_des_Liberty 阅读(189) 评论(0) 推荐(0) 编辑
摘要:A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but i 阅读全文
posted @ 2019-02-19 22:10 Veritas_des_Liberty 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. 阅读全文
posted @ 2019-02-18 00:21 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0) 编辑
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2019-02-17 23:25 Veritas_des_Liberty 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
posted @ 2019-02-16 22:59 Veritas_des_Liberty 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2019-02-16 22:24 Veritas_des_Liberty 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2019-02-16 21:47 Veritas_des_Liberty 阅读(173) 评论(0) 推荐(0) 编辑
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2019-02-16 20:51 Veritas_des_Liberty 阅读(292) 评论(0) 推荐(0) 编辑
摘要:Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2019-02-15 22:32 Veritas_des_Liberty 阅读(165) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: Approach #1: My code. [C++] Appro 阅读全文
posted @ 2019-02-15 21:59 Veritas_des_Liberty 阅读(243) 评论(0) 推荐(0) 编辑
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Approach #1: DP. [C++] Ana 阅读全文
posted @ 2019-02-15 21:49 Veritas_des_Liberty 阅读(212) 评论(0) 推荐(0) 编辑
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are ar 阅读全文
posted @ 2019-02-15 20:23 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2019-02-15 20:05 Veritas_des_Liberty 阅读(206) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2019-02-14 23:34 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页