摘要: 题目: 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 longest path b 阅读全文
posted @ 2017-04-01 23:42 panini 阅读(161) 评论(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 the 阅读全文
posted @ 2017-04-01 23:30 panini 阅读(399) 评论(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 阅读全文
posted @ 2017-04-01 05:29 panini 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There ar 阅读全文
posted @ 2017-04-01 04:41 panini 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when on 阅读全文
posted @ 2017-04-01 03:02 panini 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目: We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, w 阅读全文
posted @ 2017-04-01 02:30 panini 阅读(318) 评论(0) 推荐(0) 编辑