摘要: 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 betwe 阅读全文
posted @ 2018-03-27 13:58 轻风舞动 阅读(2100) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2018-03-27 12:52 轻风舞动 阅读(873) 评论(0) 推荐(0) 编辑
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Example 2 Note:Your al 阅读全文
posted @ 2018-03-27 12:05 轻风舞动 阅读(525) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文
posted @ 2018-03-27 04:25 轻风舞动 阅读(1401) 评论(0) 推荐(0) 编辑
摘要: Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? Hint: 274. H-Index H指数 的拓展。输入的数组是有 阅读全文
posted @ 2018-03-27 02:32 轻风舞动 阅读(479) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
posted @ 2018-03-27 02:24 轻风舞动 阅读(2327) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2018-03-27 02:09 轻风舞动 阅读(2194) 评论(0) 推荐(1) 编辑