码迷,mamicode.com
首页 >  
搜索关键字:leet    ( 148个结果
Leet Code OJ 1. Two Sum [Difficulty: Easy]
题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example: Given nums = [2, 7...
分类:其他好文   时间:2016-03-15 14:57:51    阅读次数:172
Leet-code144. Binary Tree Preorder Traversal
这是一道将二叉树先序遍历,题目不难,采用深搜  
分类:其他好文   时间:2016-03-13 17:36:59    阅读次数:112
Leet Code OJ 102. Binary Tree Level Order Traversal [Difficulty: Easy]
题目: Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree {3,9,20,#,#,15,7}, return its level order tr...
分类:其他好文   时间:2016-03-08 14:59:54    阅读次数:108
Leet Code OJ 235. Lowest Common Ancestor of a Binary Search Tree [Difficulty: Easy]
题目: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betwee...
分类:其他好文   时间:2016-03-07 15:06:42    阅读次数:148
Leet Code OJ 219. Contains Duplicate II [Difficulty: Easy]
题目: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.翻译: 给...
分类:其他好文   时间:2016-03-07 15:06:41    阅读次数:148
Leet Code OJ 223. Rectangle Area [Difficulty: Easy]
题目: Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. Assume that the total ar...
分类:其他好文   时间:2016-03-07 14:00:20    阅读次数:292
Leet Code OJ 189. Rotate Array [Difficulty: Easy]
题目: Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note: Try to come up as many solutions as you can,...
分类:其他好文   时间:2016-03-05 23:51:31    阅读次数:310
Leet Code OJ 58. Length of Last Word [Difficulty: Easy]
题目: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defin...
分类:其他好文   时间:2016-03-04 17:51:09    阅读次数:108
Leet Code OJ 21. Merge Two Sorted Lists [Difficulty: Easy]
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.翻译: 合并2个已经排序的链表,并且返回一个新的链表。这个新的链表应该由前面提到的2个链表的节点所组成。分析...
分类:其他好文   时间:2016-03-04 17:50:50    阅读次数:131
Leet Code OJ 66. Plus One [Difficulty: Easy]
题目: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.翻译: 给定一个非负数,它是有数字的数组组成,...
分类:其他好文   时间:2016-03-04 17:48:32    阅读次数:126
148条   上一页 1 ... 6 7 8 9 10 ... 15 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!