SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 95 forks source link

Create MoveZeros.Java #399

Closed vyom18 closed 2 years ago

vyom18 commented 2 years ago

Issue Id you have worked upon -

398

Briefly explain your program logic -

Here a new list is taken and numbers without zero are inserted into it. And after that numbers are replaced in an index of the array exactly the same as position in list and then zeros are appended at last.

Screenshots(Attach 2 screenshots of your own input and output) -

Example1:- Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0]

Example2:- Input: nums = [0] Output: [0]


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -