leetcode 283 移动零 move-zeroes【ct】

 ===

思路:

首先保存len变量表示当前数组长度,遍历len,如果值为0,就去掉它,并推入到数组底部,注意需要len--和i--

 

posted @ 2023-06-16 11:31  hh9515  阅读(10)  评论(0)    收藏  举报