Array Multiplier

Published by Mubashir Hassan in

Create a function that takes an array as an argument and returns a new nested array for each element in the original array. The nested array must be filled with the corresponding element in the original array and each nested array has the same amount of elements as the original array.

Examples

multiply(["*", "%", "$"]) ➞ [["*", "*", "*"], ["%", "%", "%"], ["$", "$", "$"]]

multiply(["A", "B", "C", "D", "E"]) ➞ [["A", "A", "A", "A", "A"], ["B", "B", "B", "B", "B"], ["C", "C", "C", "C", "C"], ["D", "D", "D", "D", "D"], ["E", "E", "E", "E", "E"]]

Notes

N/A

Watch a quick demo on how Edabit works.