摘要:
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
摘要:
leetcode 上的题目 Determine whether an integer is a palindrome. Do this without extra space. 由于不能使用额外空间,所以不能把数字转化为字符串后进行比较。因为这样空间复杂度将为线性。 leetcode给出了几点提示 阅读全文
摘要:
声明函数格式如下:def funcName(params):首先,函数声明以关键字def开始,接着是函数名,括号中的为参数。参数放在小括号中,多个参数之间以逗号分隔。其次,函数没有定义返回的数据类型。python不需要指定返回值的数据类型;甚至不需要指定是否有返回值。实际上,每个python函数都返回一个值,如果函数执行return语句,它将返回指定的值,否则将返回None(python的空值)文档化函数可以通过给出一个doc string 来文档化一个python函数。def buildConnectionString(params):""" Build a c 阅读全文