码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Molecule to atoms
For a given chemical formula represented by a string, count the number of atoms of each element contained in the molecule and return an object. 1 wate...
分类:其他好文   时间:2015-07-10 00:11:30    阅读次数:152
leetcoder 46-Permutations and 47-Permutations II
Permutations Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]...
分类:其他好文   时间:2015-07-09 22:45:59    阅读次数:154
STL算法设计理念 - 二元函数,二元谓词以及在set中的应用
demo 二元函数对象 #include #include #include #include using namespace std; template class SumVector { public: T operator()(T t1, T t2) // 二元函数对象 { return t1 + t2; } protected: private: }; void...
分类:编程语言   时间:2015-07-09 22:45:12    阅读次数:194
寻找回文数的python的实现
寻找回文数寻找回文数也是一个比较好玩的题目,也是学习python的一个简单的filter()函数的应用解决方法:即按照回文数的特点进行即可。方法一:一行代码解决#coding=UTF-8 #寻找回文数 def is_palindrome(n): s=str(n) return s[0:len(s)//2]==s[-1:len(s)//2:-1]...
分类:编程语言   时间:2015-07-09 22:44:12    阅读次数:288
LeetCode215:Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given [3,2,1,5,6,4] and k = 2, return 5.Note:...
分类:其他好文   时间:2015-07-09 22:41:43    阅读次数:113
连续子数组的最大和
bool g_InvalidInput = false; int FindGreatestSumOfSubArray(int *pData, int nLength) { if ((pData == NULL) || (nLength { g_InvalidInput = true; return 0; } g_InvalidInput = false; int nCurSum...
分类:编程语言   时间:2015-07-09 21:32:12    阅读次数:246
LeetCode Remove Duplicated from Sorted List
public ListNode deleteDuplicates(ListNode head) { if(head==null || head.next==null) return head; ListNode pre=head;; ...
分类:其他好文   时间:2015-07-09 21:22:49    阅读次数:141
[leedcode 35] Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:其他好文   时间:2015-07-09 19:38:18    阅读次数:112
【leetcode】Length of Last Word
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:其他好文   时间:2015-07-09 19:22:32    阅读次数:96
leetCode 35.Search Insert Position (搜索插入位置) 解题思路和方法
Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume...
分类:其他好文   时间:2015-07-09 18:07:25    阅读次数:125
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!