JavaRush /Java блог /Random /Задание для смельчаков
Fyodor
7 уровень
Санкт-Петербург

Задание для смельчаков

Статья из группы Random
Сделаем задание?) Your solution should build a pyramid from given input list of integer values. Numbers are to be sorted ascending from top to bottom, from left to right. Empty spaces are to be filled with zeros. In order to make the pyramid symmetric input numbers should alternate with zeros. For example, for input A={2, 4, 3, 5, 6, 1} the pyramid will look like: [0,0,1,0,0] [0,2,0,3,0] [4,0,5,0,6] Refer to unit-tests for more examples. Input and expected output Input: List with integer values Output: 2D array with the pyramid or CannotBuildPyramidException if it's not possible to build one
Комментарии (1)
ЧТОБЫ ПОСМОТРЕТЬ ВСЕ КОММЕНТАРИИ ИЛИ ОСТАВИТЬ КОММЕНТАРИЙ,
ПЕРЕЙДИТЕ В ПОЛНУЮ ВЕРСИЮ
Dannyson Уровень 41
16 ноября 2020
Решил?