随笔分类 - Weekly Contest
发表于 2020-05-10 18:05阅读:323评论:0推荐:0
摘要:Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one
阅读全文 »
发表于 2020-04-12 17:45阅读:243评论:0推荐:0
摘要:1408. String Matching in an Array Given an array of string words. Return all strings in words which is substring of another word in any order. String
阅读全文 »
发表于 2019-06-02 16:33阅读:325评论:0推荐:0
摘要:1071. Greatest Common Divisor of Strings For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or mor
阅读全文 »
发表于 2019-05-19 15:21阅读:390评论:0推荐:0
摘要:1046. Last Stone Weight We have a collection of rocks, each rock has a positive integer weight. Each turn, we choose the two heaviest rocks and smash
阅读全文 »
发表于 2019-04-21 17:09阅读:249评论:0推荐:0
摘要:1030. Matrix Cells in Distance Order We are given a matrix with R rows and C columns has cells with integer coordinates (r, c), where 0 <= r < R and 0
阅读全文 »
发表于 2019-04-14 17:50阅读:314评论:0推荐:0
摘要:1025. Divisor Game Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each playe
阅读全文 »
发表于 2019-04-07 20:39阅读:234评论:0推荐:0
摘要:1021. Remove Outermost Parentheses A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strin
阅读全文 »
发表于 2019-03-31 12:15阅读:201评论:0推荐:0
摘要:1029. Binary Prefix Divisible By 5 Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (fr
阅读全文 »
发表于 2019-03-24 14:40阅读:251评论:0推荐:0
摘要:1020. Partition Array Into Three Parts With Equal Sum Given an array A of integers, return true if and only if we can partition the array into three n
阅读全文 »
发表于 2019-03-17 17:19阅读:238评论:0推荐:0
摘要:1012. Complement of Base 10 Integer Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11
阅读全文 »
发表于 2019-01-27 13:21阅读:260评论:0推荐:0
摘要:984. String Without AAA or BBB Given two integers A and B, return any string S such that: S has length A + B and contains exactly A 'a' letters, and e
阅读全文 »
发表于 2019-01-06 12:43阅读:221评论:0推荐:0
摘要:970. Powerful Integers Given two non-negative integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0
阅读全文 »
发表于 2018-12-30 13:40阅读:312评论:0推荐:0
摘要:965. Univalued Binary Tree A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univa
阅读全文 »
发表于 2018-12-23 12:57阅读:247评论:0推荐:0
摘要:961. N-Repeated Element in Size 2N Array In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times
阅读全文 »
发表于 2018-12-16 12:53阅读:216评论:0推荐:0
摘要:958. Check Completeness of a Binary Tree Given a binary tree, determine if it is a complete binary tree. Definition of a complete binary tree from Wik
阅读全文 »
发表于 2018-12-09 17:02阅读:260评论:0推荐:0
摘要:955. Delete Columns to Make Sorted II We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of del
阅读全文 »
发表于 2018-12-02 12:55阅读:229评论:0推荐:0
摘要:949. Largest Time for Given Digits (string::compare) Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hou
阅读全文 »
发表于 2018-11-25 12:44阅读:362评论:0推荐:0
摘要:945. Minimum Increment to Make Array Unique Given an array of integers A, a move consists of choosing any A[i], and incrementing it by 1. Return the l
阅读全文 »