随笔分类 -  Review && Digest

Problems and techniques that you did not come up by yourself. Need to review to make it stick with your brain.
摘要: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 阅读(194) 评论(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 阅读(647) 评论(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 阅读(792) 评论(0) 推荐(0)
摘要: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 @ 2021-02-17 01:45 Review->Improve 阅读(246) 评论(0) 推荐(0)
摘要:You are given a 0-indexed integer array nums and an integer k. You are initially standing at index 0. In one move, you can jump at most k steps forwar 阅读全文
posted @ 2021-02-16 12:05 Review->Improve 阅读(604) 评论(0) 推荐(0)
摘要:Given a rows * columns matrix mat of ones and zeros, return how many submatrices have all ones. Example 1: Input: mat = [[1,0,1], [1,1,0], [1,1,0]] Ou 阅读全文
posted @ 2021-02-16 06:13 Review->Improve 阅读(849) 评论(0) 推荐(0)
摘要:Problem Link: C - Mandarin Orange The problem can be converted to as such: Given an array A of positive integers, find out the the maximum product val 阅读全文
posted @ 2021-02-16 01:08 Review->Improve 阅读(114) 评论(0) 推荐(0)
摘要:Given a m * n matrix of ones and zeros, return how many square submatrices have all ones. Example 1: Input: matrix = [ [0,1,1,1], [1,1,1,1], [0,1,1,1] 阅读全文
posted @ 2021-02-12 12:01 Review->Improve 阅读(259) 评论(0) 推荐(0)
摘要:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Input: [[1,1],[2,2],[3,3]] Output: 3 Ex 阅读全文
posted @ 2021-02-07 09:25 Review->Improve 阅读(63) 评论(0) 推荐(0)
摘要:You are given an array target that consists of distinct integers and another integer array arr that can have duplicates. In one operation, you can ins 阅读全文
posted @ 2021-02-06 03:18 Review->Improve 阅读(213) 评论(0) 推荐(0)
摘要:You are given a two-dimensional list of integers matrix. You are currently at the top left corner and want to move to the bottom right corner. In each 阅读全文
posted @ 2021-02-04 07:36 Review->Improve 阅读(94) 评论(0) 推荐(0)
摘要:You are given a list of integers nums and an integer k. Consider an operation where you increment any one element once(increase by 1). Given that you 阅读全文
posted @ 2021-02-03 11:58 Review->Improve 阅读(371) 评论(0) 推荐(0)
摘要:You are given an integer array nums of even length n and an integer limit. In one move, you can replace any integer from nums with another integer bet 阅读全文
posted @ 2021-01-06 10:10 Review->Improve 阅读(314) 评论(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 阅读(466) 评论(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)
摘要: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 阅读(181) 评论(0) 推荐(0)
摘要:The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
posted @ 2020-06-22 03:35 Review->Improve 阅读(445) 评论(0) 推荐(0)
摘要:Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret 阅读全文
posted @ 2020-05-27 06:54 Review->Improve 阅读(300) 评论(0) 推荐(0)
摘要:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks coul 阅读全文
posted @ 2020-05-27 03:13 Review->Improve 阅读(259) 评论(0) 推荐(0)
摘要:Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find th 阅读全文
posted @ 2020-05-05 02:47 Review->Improve 阅读(537) 评论(0) 推荐(0)