about | help | code help+videos | done | prefs |
Write a method that accepts an array of integers and returns an array containing the same integers, but grouped by least-significant digit. The grouping must be in order from 0 to 9 of the least-significant digit, but within the group the order of the numbers has not been changed. For example, the array {53,72,18,12,42,83,91,78} becomes {91, 72, 12, 42, 53, 83, 18, 78}. Look at the test data for additional examples. This is easier than it sounds... especially if you don't try to make it super-efficient. jan30_2020_HL_groupBy([7, 5, 3, 2]) → [2, 3, 5, 7] jan30_2020_HL_groupBy([5312, 436, 124, 543615, 346, 62436, 8643, 398, 52398, 523, 64]) → [5312, 8643, 523, 124, 64, 543615, 436, 346, 62436, 398, 52398] jan30_2020_HL_groupBy([142, 436, 9814, 432, 634, 42198, 364, 32, 5437, 53298]) → [142, 432, 32, 9814, 634, 364, 436, 5437, 42198, 53298] ...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: 290
Copyright Nick Parlante 2017 - privacy