Draft

Array Compression #1

Description:

This is the first in a series of Kata's about compressing an array.

For this one, you are given an array, and your job is to take all repeating items, and compress them in the following format [item, count]

Ex.

[1, 2, 5, 5, 5, 3, 3, 7, 8, 8] => [1, 2, [5, 3], [3, 2], 7, [8, 2]]

You can assume the array will always contain a value and will only contain integers and strings.

Arrays
Algorithms

More By Author:

Check out these other kata created by funnbot

Stats:

CreatedApr 15, 2018
Warriors Trained164
Total Skips8
Total Code Submissions147
Total Times Completed45
JavaScript Completions45
Total Stars2
% of votes with a positive feedback rating79% of 31
Total "Very Satisfied" Votes21
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes3
Total Rank Assessments30
Average Assessed Rank
7 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • funnbot Avatar
  • cliffstamp Avatar
Ad