摘要:
以下内容是学习Python Tutorial的个人学习笔记: 一.循环控制语句 1.在for循环中修改迭代序列是不安全的,我们可以通过修改迭代序列副本来规避这个问题。 比如:原来的迭代是 for word in words,那么现在有在for循环中修改words,我们就要把它变成 for word 阅读全文
摘要:
Description: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your al 阅读全文
摘要:
Description: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 第二种想法:第i行有i个数;每次往最前面插入一个1,那么除了头尾以外, 阅读全文
摘要:
Description: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2 阅读全文
摘要:
Description: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for anothe 阅读全文
摘要:
description: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should 阅读全文