摘要: 今天学习廖老师的python教程,碰到了修饰符'@',不太了解,查看了下官方文档。简单的整理下:@dec2@dec1def func(arg1, arg2, ...): pass 等价于def func(arg1, arg2, ...): passfunc = dec2(dec1(fun... 阅读全文
posted @ 2015-09-12 22:30 小金乌会发光-Z&M 阅读(983) 评论(0) 推荐(0) 编辑
摘要: Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great... 阅读全文
posted @ 2015-08-17 21:41 小金乌会发光-Z&M 阅读(153) 评论(0) 推荐(0) 编辑
摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2015-08-12 16:07 小金乌会发光-Z&M 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 作为安装程序的Setup文件是软件的开发者专门为其软件设计的.exe文件,是当前最为盛行的安装程序。在运行该Setup文件进行软件安装时,Setup除了进行复制、改名、解压和目录维护等基本安装工作外,还要对系统进行必要的配置,通常是修改config.sys、autoexec.bat和注册表等文件,以 阅读全文
posted @ 2015-08-09 12:16 小金乌会发光-Z&M 阅读(3196) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion10.01代码如下:class Solution { public: int compareVersion(strin... 阅读全文
posted @ 2015-08-04 22:02 小金乌会发光-Z&M 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-07-30 22:36 小金乌会发光-Z&M 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-07-29 22:25 小金乌会发光-Z&M 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving(检索) the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Rem... 阅读全文
posted @ 2015-07-28 22:29 小金乌会发光-Z&M 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2015-07-26 14:55 小金乌会发光-Z&M 阅读(426) 评论(0) 推荐(0) 编辑
摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析:题意即为 阶乘尾部的零(求n!中尾部为0的个数)思路... 阅读全文
posted @ 2015-07-26 13:31 小金乌会发光-Z&M 阅读(201) 评论(0) 推荐(0) 编辑