about | help | code help+videos | done | prefs |
Write a method noLeadingZeros which is passed an array of integers and which returns a new array that is a copy of the array passed to the method without any leading zeros. For example if the array {0,0,0,5,3,9,0,2} was passed to the method, the array {5, 3, 9, 0, 2} would be returned. If an empty array is passed to the method, it should return an empty array. noLeadingZeros([0, 0, 0, 5, 3, 9, 0, 2]) → [5, 3, 9, 0, 2] noLeadingZeros([4, 2, 1, 0]) → [4, 2, 1, 0] noLeadingZeros([0, 3, 0, 0, 9, 7]) → [3, 0, 0, 9, 7] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy