![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
练习java基础
tester_nie
这个作者很懒,什么都没留下…
展开
-
Remove Duplicates from Sorted Array (java版)
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with翻译 2017-04-06 22:40:31 · 231 阅读 · 1 评论 -
Remove Element (java版)
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 another array, you must do this in place with constant memory. The翻译 2017-04-06 21:39:20 · 589 阅读 · 0 评论 -
Remove Duplicates from Sorted Array II(java版)
Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,3], Your function should return length = 5, with the first five e翻译 2017-04-16 13:37:48 · 132 阅读 · 0 评论 -
Pascal's Triangle(java版)
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 帕斯卡三角 找规律 1、第k层有k个元素 2、每层第一翻译 2017-04-16 14:25:56 · 228 阅读 · 0 评论 -
Pascal's Triangle II
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 algorithm to use only O(k) extra space? Subscribe to see翻译 2017-04-16 20:12:23 · 137 阅读 · 1 评论 -
Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit翻译 2017-06-04 13:20:26 · 144 阅读 · 0 评论