摘要:题目描述: Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate
阅读全文
摘要:题目描述: Given an array nums and a value val, remove all instances of that value in-placeand return the new length. Do not allocate extra space for anoth
阅读全文
摘要:题目描述: Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate ext
阅读全文
摘要:题目描述: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. 实现思路: 定义区间
阅读全文
摘要:对于任意一个无理数α,我们一定能够找到两个有理数列 α1,α2,... 及 α1‘,α2’,... 使得αn < α < αn' , 且 lim αn = lim αn' = α
阅读全文
摘要:switch语句 优点: 可以把若干个分支组合在一起完成一个任务。 隐患: 但是正常情况下为了防止直接进入下一个分支执行,每个分支后必须以break语句结束。从一个分支直接进入下一个分支执行的做法并不健全,这样在做程序修改时很容易出错。 建议: 在switch语句最后一个分支的后面(即default
阅读全文