随笔分类 -  Algorithm

上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要:Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. T 阅读全文
posted @ 2020-09-26 01:32 Review->Improve 阅读(340) 评论(0) 推荐(0)
摘要:You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means 阅读全文
posted @ 2020-09-24 05:22 Review->Improve 阅读(107) 评论(0) 推荐(0)
摘要:Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example 1: Input: matri 阅读全文
posted @ 2020-09-24 04:15 Review->Improve 阅读(164) 评论(0) 推荐(0)
摘要:There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color is different. Yo 阅读全文
posted @ 2020-09-23 13:03 Review->Improve 阅读(177) 评论(0) 推荐(0)
摘要:There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai 阅读全文
posted @ 2020-09-23 13:02 Review->Improve 阅读(265) 评论(0) 推荐(0)
摘要:Given two strings s and t, you want to transform string s into string t using the following operation any number of times: Choose a non-empty substrin 阅读全文
posted @ 2020-09-15 22:32 Review->Improve 阅读(468) 评论(0) 推荐(0)
摘要:Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-decreasing. A subarray is a cont 阅读全文
posted @ 2020-09-08 05:41 Review->Improve 阅读(1130) 评论(0) 推荐(0)
摘要:I have run into 2 different problems that can be solved using binary lifting. Then there is second thread's tree basics youtube video that talks about 阅读全文
posted @ 2020-08-25 11:53 Review->Improve 阅读(257) 评论(0) 推荐(0)
摘要:Given an array arr that represents a permutation of numbers from 1 to n. You have a binary string of size n that initially has all its bits set to zer 阅读全文
posted @ 2020-08-25 01:47 Review->Improve 阅读(510) 评论(0) 推荐(0)
摘要:Given an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n. A marathon will be held on t 阅读全文
posted @ 2020-08-24 23:47 Review->Improve 阅读(866) 评论(0) 推荐(0)
摘要:On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; D 阅读全文
posted @ 2020-08-23 04:57 Review->Improve 阅读(268) 评论(0) 推荐(0)
摘要:Your task is to form an integer array nums from an initial array of zeros arr that is the same size as nums. Return the minimum number of function cal 阅读全文
posted @ 2020-08-23 04:05 Review->Improve 阅读(413) 评论(0) 推荐(0)
摘要:Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. Th 阅读全文
posted @ 2020-08-21 11:37 Review->Improve 阅读(308) 评论(0) 推荐(0)
摘要:In universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n emp 阅读全文
posted @ 2020-08-17 07:08 Review->Improve 阅读(872) 评论(0) 推荐(0)
摘要:Start from integer 1, remove any integer that contains 9 such as 9, 19, 29... So now, you will have a new integer sequence: 1, 2, 3, 4, 5, 6, 7, 8, 10 阅读全文
posted @ 2020-08-16 06:52 Review->Improve 阅读(182) 评论(0) 推荐(0)
摘要:Given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps in order to make it palindrome. Return 阅读全文
posted @ 2020-08-15 01:52 Review->Improve 阅读(401) 评论(0) 推荐(0)
摘要:There are G people in a gang, and a list of various crimes they could commit. The i-th crime generates a profit[i] and requires group[i] gang members 阅读全文
posted @ 2020-08-12 10:32 Review->Improve 阅读(368) 评论(0) 推荐(0)
摘要:Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. Example: Input: 13 Output: 6 Exp 阅读全文
posted @ 2020-08-11 00:21 Review->Improve 阅读(236) 评论(0) 推荐(0)
摘要:Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbours of it if they exist (Flip is changing 1 阅读全文
posted @ 2020-07-28 10:17 Review->Improve 阅读(1049) 评论(0) 推荐(0)
摘要:Given an array of positive integers target and an array initial of same size with all zeros. Return the minimum number of operations to form a target  阅读全文
posted @ 2020-07-27 12:26 Review->Improve 阅读(884) 评论(0) 推荐(1)

上一页 1 2 3 4 5 6 7 ··· 10 下一页