原创 【leetcode】【medium】474. Ones and Zeroes
474. Ones and Zeroes In the computer world, use restricted resource you have to generate maximum benefit is what we alw
原创 【leetcode】【easy】【每日一題】面試題 17.16. The Masseuse LCCI
面試題 17.16. The Masseuse LCCI A popular masseuse receives a sequence of back-to-back appointment requests and is debatin
原创 【leetcode】【hard】493. Reverse Pairs
493. Reverse Pairs Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You
原创 【leetcode】【medium】【每日一題】287. Find the Duplicate Number
287. Find the Duplicate Number Given an array nums containing n + 1 integers where each integer is between 1 and n (inc
原创 【leetcode】【easy】【每日一題】914. X of a Kind in a Deck of Cards
914. X of a Kind in a Deck of Cards In a deck of cards, each card has an integer written on it. Return true if and only
原创 【leetcode】【medium】215. Kth Largest Element in an Array
215. Kth Largest Element in an Array Find the kth largest element in an unsorted array. Note that it is the kth largest
原创 【leetcode】【medium】【每日一題】912. Sort an Array
912. Sort an Array Given an array of integers nums, sort the array in ascending order. Example 1: Input: nums = [5,2,3
原创 【leetcode】【medium】【每日一題】820. Short Encoding of Words
820. Short Encoding of Words Given a list of words, we may encode it by writing a reference string S and a list of inde
原创 【leetcode】【medium】【每日一題】22. Generate Parentheses
22. Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed par
原创 【kick start】2020 A round
這裏的代碼只貼solution函數,代碼框架請看這篇:kick start代碼框架。 比賽鏈接:https://codingcompetitions.withgoogle.com/kickstart/round/000000000019f
原创 【leetcode】【easy】703. Kth Largest Element in a Stream
703. Kth Largest Element in a Stream Design a class to find the kth largest element in a stream. Note that it is the kt
原创 【leetcode】【medium】【每日一題】1162. As Far from Land as Possible
1162. As Far from Land as Possible Given an N x N grid containing only values 0 and 1, where 0 represents water and 1 r
原创 【leetcode】第 182 場周賽
可能因爲剛應付完一系列面試,這週末狀態明顯鬆懈,比賽的時候心態也很佛。。比賽過程不多解釋,就着重寫題目分析了。 賽後總結 不足 1. 容器使用還是不夠透徹,map的初始化要搞清楚。 優點 1. 簡單題做的很快。 2. 心態是真的好,不過有
原创 【leetcode】【medium】【每日一題】1111. Maximum Nesting Depth of Two Valid Parentheses Strings
1111. Maximum Nesting Depth of Two Valid Parentheses Strings A string is a valid parentheses string (denoted VPS) if
原创 【leetcode】【easy】【每日一題】面試題62. 圓圈中最後剩下的數字
面試題62. 圓圈中最後剩下的數字 0,1,,n-1這n個數字排成一個圓圈,從數字0開始,每次從這個圓圈裏刪除第m個數字。求出這個圓圈裏剩下的最後一個數字。 例如,0、1、2、3、4這5個數字組成一個圓圈,從數字0開始每次刪除第3個數字,