Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 823 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 823 Bytes

PS02: Duplicating zeros

Given a list of integers arr, modify it such that every 0 appears twice while maintaining the original list size. Modify the list in place.

Example 1:

  • Input: [1,0,2,3,0,4,5,0]
  • Output: None
  • Why?: After calling your solution, the input array is modified to [1,0,0,2,3,0,0,4].

How to submit

  • Complete the function duplicate_zeros under solution.py
  • Push your changes to master.
  • Your code must be readable, pylint checks will be run against each push.
  • Your code must pass all test cases. grader.py will be run against all input test cases inside test_cases/
  • Enjoy 💕!

Debugging

  • You can run a test case py running python grader.py < test_cases/TEST where TEST is the particular test case you want to run.