摘要: 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)