about | help | code help+videos | done | prefs |
Given an integer array "a", compress the data using run-length encoding (RLE). RLE means that an array such as 1,1,1,2,2,2,2,2 could be compressed to 3,1,5,2 meaning that there are three 1's and then five 2's. compress_integerArray([1, 2]) → [1, 1, 1, 2] compress_integerArray([1, 1, 1, 2, 2, 2, 2, 2]) → [3, 1, 5, 2] compress_integerArray([5, 5, 5, -1, -1, -1]) → [3, 5, 3, -1] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy