上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 76 下一页
摘要: We distribute some number of candies, to a row of n = num_people people in the following way: We then give 1 candy to the first person, 2 candies to t 阅读全文
posted @ 2020-08-17 21:50 Schwifty 阅读(127) 评论(0) 推荐(0)
摘要: Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2020-08-17 12:56 Schwifty 阅读(150) 评论(0) 推荐(0)
摘要: Given the root of a binary search tree with distinct values, modify it so that every node has a new value equal to the sum of the values of the origin 阅读全文
posted @ 2020-08-17 12:41 Schwifty 阅读(126) 评论(0) 推荐(0)
摘要: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
posted @ 2020-08-17 12:40 Schwifty 阅读(92) 评论(0) 推荐(0)
摘要: Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar 阅读全文
posted @ 2020-08-17 12:03 Schwifty 阅读(84) 评论(0) 推荐(0)
摘要: You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e. 0 <= i < n). In one operation, you can select two indices 阅读全文
posted @ 2020-08-16 14:11 Schwifty 阅读(226) 评论(0) 推荐(0)
摘要: Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. Example 1: Input: arr = [2,6 阅读全文
posted @ 2020-08-16 13:42 Schwifty 阅读(213) 评论(0) 推荐(0)
摘要: Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th 阅读全文
posted @ 2020-08-16 13:21 Schwifty 阅读(108) 评论(0) 推荐(0)
摘要: Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we have some array B 阅读全文
posted @ 2020-08-15 14:27 Schwifty 阅读(84) 评论(0) 推荐(0)
摘要: Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may re 阅读全文
posted @ 2020-08-15 14:17 Schwifty 阅读(94) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 76 下一页