about | help | code help+videos | done | prefs |
resize
Given an array of integers, resize the array to the specified size. If the new size is smaller than the original size truncate the array. If the new size is greater than the original side, pad the end of the array with the value -1. The specified size will be non-negative. resize([3, 4, 5], 7) → [3, 4, 5, -1, -1, -1, -1] resize([3, 4, 5], 2) → [3, 4] resize([8, 6, 7, 5, 3, 0, 9], 1) → [8] ...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