- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 Leetcode 33. Search in Rotated Sorted Array
原题:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to search. If found i...
2018-04-29 23:30:03 80
原创 Leetcode 45. Jump Game II
原题:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to ...
2018-04-28 12:05:34 106
原创 Leetcode 41. First Missing Positive
原题:Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Output: 1Note:Yo...
2018-04-24 00:23:20 246
原创 2018.4.8 Python作业
第十一章 测试类11-1 城市和国家:编写一个函数,它接受两个形参:一个城市名和一个国家名。这个函数返回一个格式为City,Country的字符串,如Santiago,Chile。将这个函数存储在一个名为city_functions.py的模块中。创建一个名为test_cities.py的程序,对刚编写的函数进行测试(别忘了,你需要导入模块unittest以及要测试的函数)。编写一个名为test_...
2018-04-15 02:13:17 252
原创 2018.4.4 Python作业
第十章 文件和异常10-1 Python学习笔记:在文本编辑器中新建一个文件,写几句话来总结一下你至今学到的Python知识,其中每一行都以“In Python you can”打头。将这个文件命名为learning_python.txt,并将其存储到为完成本章练习而编写的程序所在的目录中。编写一个程序,它读取这个文件,并将你所写的内容打印三次:第一次打印时读取整个文件;第二次打印时遍历文件对象;...
2018-04-07 18:55:40 212
原创 2018.4.2 Python作业
第九章 类9-3 用户:创建一个名为User的类,其中包含属性first_name,last_name,还有用户简介通常会存储的其他几个属性。在类User中定义一个名为describe_user()的方法,它打印用户信息摘要;再定义一个名为greet_user()的方法,它向用户发出个性化的问候。创建多个表示不同用户的实例,并对每个实例都调用以上两个方法。class User(): def...
2018-04-03 19:41:30 233
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人