1 2 3 4 5 ··· 37 下一页
摘要: Key idea: For a given box and a list of balls that can be placed in this box, we should choose the ball with the smallest R. Proof: say we have box B 阅读全文
posted @ 2023-10-01 02:50 Review->Improve 阅读(17) 评论(0) 推荐(0) 编辑
摘要: Incorrect solution: greedily find out how many consecutive S we can convert to all o. Then for the remaining replace operations, try each starting pos 阅读全文
posted @ 2023-09-14 05:14 Review->Improve 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Problem Statment Assume the first N - 1 rounds have been played and we are left with a %7 value R. There are 2 cases depending on who plays the last r 阅读全文
posted @ 2023-09-11 06:47 Review->Improve 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Problem Statement If we add edges between every pair of sets that have shared elements, there will be O(N^2) edges to traverse. Instead, we can add N 阅读全文
posted @ 2023-07-17 10:54 Review->Improve 阅读(37) 评论(0) 推荐(0) 编辑
摘要: The key observation is that there is always at most 1 cell that violates both conditions. Proof: if x violates both conditions, that means all other n 阅读全文
posted @ 2023-03-21 23:38 Review->Improve 阅读(9) 评论(0) 推荐(0) 编辑
摘要: You are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a c 阅读全文
posted @ 2023-02-21 07:34 Review->Improve 阅读(20) 评论(0) 推荐(0) 编辑
摘要: Problem Statement dp[i][j]: the number of subsets of A[0, i] whose sum is j. dp[0][0] = 1, there is only 1 way of not picking anything from an empty a 阅读全文
posted @ 2023-02-21 01:13 Review->Improve 阅读(19) 评论(0) 推荐(0) 编辑
摘要: You are given a 2D integer array, queries. For each queries[i], where queries[i] = [ni, ki], find the number of different ways you can place positive 阅读全文
posted @ 2023-01-06 07:22 Review->Improve 阅读(19) 评论(0) 推荐(0) 编辑
摘要: Problem Statement 1. N is up to 35, so trying all possible subsequences is too slow (2^35). We can apply the meet in the middle technique and divide A 阅读全文
posted @ 2022-09-30 10:49 Review->Improve 阅读(23) 评论(0) 推荐(0) 编辑
摘要: You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (in 阅读全文
posted @ 2022-03-30 00:50 Review->Improve 阅读(108) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 37 下一页