- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 第八周LeetCode
题目 难度 Easy Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Give
2017-10-27 21:20:39 166
原创 第八周LeetCode
题目 难度 Easy Employee Importance You are given a data structure of employee information, which includes the employee’s unique id, his importance value and his direct subordinates’ id. For exa
2017-10-27 20:40:03 239
原创 第七周LeetCode
题目 难度 Medium Pow(x, n) Implement pow(x, n). 实现思路 本来想用循环连乘n次x算出来,结果妥妥的超时。然后参考了一下别人的算法, 利用 xn={xx(n/2)x(n/2)x(n/2)x(n/2)x为奇数x为偶数 其中除号为向下取整 x^n=\begin{cases}
2017-10-20 20:23:27 135
原创 第七周LeetCode
题目 难度 Medium Reverse Words in a String Given an input string, reverse the string word by word. For example, Given s = “the sky is blue”, return “blue is sky the”. Update (2015-02-
2017-10-20 19:54:02 158
原创 第六周LeetCode
题目 难度 Medium Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2.
2017-10-13 21:31:42 148
原创 LeetCode第六周
题目 难度 Medium Add Two Numbers II You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single di
2017-10-13 21:21:49 136
原创 第六周LeetCode
题目 难度 Medium Replace Words In English, we have a concept called root, which can be followed by some other words to form another longer word - let’s call this word successor. For example, the roo
2017-10-11 21:17:52 156
原创 第六周LeetCode
题目 难度 Medium Implement a MapSum class with insert, and sum methods. For the method insert, you’ll be given a pair of (string, integer). The string represents the key and the integer represents
2017-10-11 20:35:45 185
原创 第五周LeetCode
题目 Can Place Flowers Suppose you have a long flowerbed in which some of the plots are planted and some are not.However, flowers cannot be planted in adjacent plots - they would compete for water a
2017-10-06 19:32:46 127
原创 第四周LeetCode
题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has
2017-10-02 11:05:13 176
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人