题目来源
初始思路:同时循环遍历两个数组,选出较小元素放入新数组。剩下一个没有被遍历完的数组的剩余元素直接拼接到新数组后。
错误示例:
var merge function (nums1, m, nums2, n) {let i 0,j 0,nums3 [];while (i < m &&am…
本文所用资料下载
一. Representing text Let’s load Jane Austen’s Pride and Prejudice. We first split our text into a list of lines and pick an arbitrary line to focus on:
with open(D:jane-austen/1342-0.txt, encodingutf8) as f:text f.read()
lines text.…