Open chrismejia opened 9 months ago
Given a 2D array, return a 2D array where all multiples of a number are collected into subarrays. Subarrays order is from least to greatest.
let noRepeats = [ [1,3,4], [2,5] ] // becomes... let noRepeats = [ [1], [2], [3], [4], [5] ]
let hasRepeats = [ [1,6,2,8,9], [9,1,7,5,2] ] // becomes... let hasRepeats = [ [1,1], [2,2], [5], [6], [7], [8], [9,9] ]
Idea
Given a 2D array, return a 2D array where all multiples of a number are collected into subarrays. Subarrays order is from least to greatest.
Examples
Single nums
Collecting repeats