{"size": 451, "ext": "js", "max_stars_repo_path": "Solution_07.js", "max_stars_repo_name": "Baavgai/ten_simple_coding_tests", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Solution_07.js", "max_issues_repo_name": "Baavgai/ten_simple_coding_tests", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Solution_07.js", "max_forks_repo_name": "Baavgai/ten_simple_coding_tests", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.6923076923, "max_line_length": 109, "alphanum_fraction": 0.4922394678}
import { createTester, compareArrays } from "./util.js";

const solution = xs => {
    const [acc, zs] = xs.reduce(([acc, zs], x) => x === 0 ? [acc, [...zs, x]] : [[...acc, x], zs], [[], []]);
    return [...acc, ...zs];
};

const tester = createTester("move zeros", solution, compareArrays);
export const tests = [
    tester([[0, 1, 0, 3, 12]], [1, 3, 12, 0, 0]),
    tester([[1, 7, 0, 0, 8, 0, 10, 12, 0, 4]], [1, 7, 8, 10, 12, 4, 0, 0, 0, 0]),
];
