(5/31/16)Leetcode 283. Move Zeroes

Easy 用时5分钟。
精简代码: version 1,未merge逻辑

public class Solution {
    public void moveZeroes(int[] nums) {
        int slow = 0;
        int length = nums.length;
        for (int i=0;i

Version2: merge if else

public class Solution {
    public void moveZeroes(int[] nums) {
        //8:38
        int slow = 0;
        int length = nums.length;
        for (int i=0;i

你可能感兴趣的:((5/31/16)Leetcode 283. Move Zeroes)