上一页 1 2 3 4 5 6 ··· 37 下一页
摘要: There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactly k sticks are visible from t 阅读全文
posted @ 2022-03-16 22:38 Review->Improve 阅读(62) 评论(0) 推荐(0) 编辑
摘要: Problem Link Dp[i][j]: the number of possible ways from s[0, i] with the ith statement ending with indentation j. dp[0][0] = 1, the 1st statement must 阅读全文
posted @ 2022-02-07 23:04 Review->Improve 阅读(59) 评论(0) 推荐(0) 编辑
摘要: A. Counting Kangaroos is Fun There can be only at most N / 2 hold and held pairs based the problem's statment. So a greedy approach is just to divide 阅读全文
posted @ 2022-01-24 12:52 Review->Improve 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Problem First I thought about modelling this problem as a directed graph, where between each pair of nodes, an edge represents a valid < > or > < tran 阅读全文
posted @ 2022-01-20 01:05 Review->Improve 阅读(57) 评论(0) 推荐(0) 编辑
摘要: Problem S: the set of numbers said by player 1; P: the set of numbers said by player 2; S^2 * P = a; S * P^2 = b; a * b = (S * P)^3, so a * b must be 阅读全文
posted @ 2022-01-18 06:35 Review->Improve 阅读(18) 评论(0) 推荐(0) 编辑
摘要: Problem Each fence is increased at most 2 times, so dp[i][j] is the min cost to make A[0, i] great with the last fence A[i] increased j times. The ans 阅读全文
posted @ 2022-01-18 03:22 Review->Improve 阅读(36) 评论(0) 推荐(0) 编辑
摘要: Problem Key idea: 1. for any substring s, if we can do not consider padding prefix 0s, its decimal value is always >= its length. 2. Appending a binar 阅读全文
posted @ 2022-01-17 13:44 Review->Improve 阅读(38) 评论(0) 推荐(0) 编辑
摘要: Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pai 阅读全文
posted @ 2021-02-18 08:35 Review->Improve 阅读(171) 评论(0) 推荐(0) 编辑
摘要: You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文
posted @ 2021-02-18 02:41 Review->Improve 阅读(616) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string, encode the string such that its encoded length is the shortest. The encoding rule is: k[encoded_string], where the encoded_s 阅读全文
posted @ 2021-02-17 06:06 Review->Improve 阅读(756) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 37 下一页