摘要: 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 @ 2017-03-22 08:12 amazingzoe 阅读(117) 评论(0) 推荐(0) 编辑
摘要: During the NBA playoffs, we always arrange the rather strong team to play with the rather weak team, like make the rank 1 team play with the rank nth  阅读全文
posted @ 2017-03-22 07:37 amazingzoe 阅读(241) 评论(0) 推荐(0) 编辑
摘要: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2017-03-22 07:12 amazingzoe 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2017-03-22 06:40 amazingzoe 阅读(376) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2017-03-22 06:12 amazingzoe 阅读(176) 评论(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 @ 2017-03-22 05:47 amazingzoe 阅读(131) 评论(0) 推荐(0) 编辑