摘要: 283. 移动零 自己的 思路是双指针,右指针用来找非零元素,找到后赋值给左指针,保证左指针的左面都是非零元素。遍历到最后,让左指针本身和右边全为零即可 class Solution { public void moveZeroes(int[] nums) { int i = 0; int j = 阅读全文
posted @ 2024-03-26 09:16 清澈的澈 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 非递减顺序,即非严格递增序列 自己没写出来 class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int tail1 = m-1; int tail2 = n-1; int tail = nums1. 阅读全文
posted @ 2024-03-26 09:15 清澈的澈 阅读(3) 评论(0) 推荐(0) 编辑