- 博客(14)
- 收藏
- 关注
原创 leetcode 100. Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.Subscribe to
2016-07-21 18:37:57 252
原创 leetcode 238. Product of Array Except Self
Given an array of n integers where n > 1, nums, return an arrayoutput such that output[i] is equal to the product of all the elements ofnums except nums[i].Solve it without division and in O(n).
2016-07-21 18:06:55 252
原创 leetcode 237. Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value
2016-07-21 17:43:29 260
原创 leetcode 349. Intersection of Two Arrays
Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return[2].Note:Each element in the result must be unique.The result c
2016-07-21 17:38:55 207
原创 leetcode 376. Wiggle Subsequence
A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either pos
2016-07-21 17:26:11 1437 1
原创 leetcode 283. Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your fu
2016-07-21 16:37:06 209
原创 leetcode 260. Single Number III
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums =
2016-07-21 16:35:33 230
原创 leetcode 226. Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by Max Howe
2016-07-21 15:45:32 183
原创 leetcode 104. Maximum Depth of Binary Tree
104. Maximum Depth of Binary TreeTotal Accepted: 160295Total Submissions: 328352Difficulty: EasyGiven a binary tree, find its maximum depth.The maximum depth is the numbe
2016-07-21 15:42:22 269
原创 leetcode 258
258. Add DigitsTotal Accepted: 110807Total Submissions: 224904Difficulty: EasyGiven a non-negative integer num, repeatedly add all its digits until the result has only one
2016-07-21 15:35:49 223
原创 leetcode 136
136. Single NumberTotal Accepted: 139245Total Submissions: 273783Difficulty: MediumGiven an array of integers, every element appears twice except for one. Find that single
2016-07-21 15:30:57 240
原创 leetcode 371
371. Sum of Two IntegersTotal Accepted: 15459Total Submissions: 29688Difficulty: EasyCalculate the sum of two integers a and b, but you are not allowed to use the operato
2016-07-21 15:17:25 195
原创 leetcode 7
7. Reverse IntegerTotal Accepted: 152273Total Submissions: 640718Difficulty: EasyReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -3
2016-07-21 14:58:06 222
原创 leetcode 231
231. Power of TwoTotal Accepted: 86376Total Submissions: 228380Difficulty: EasyGiven an integer, write a function to determine if it is a power of two.Credits:Special t
2016-07-21 14:09:22 259
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人