Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 764 Bytes

lario_and_muigi_pipe_problem.md

File metadata and controls

23 lines (17 loc) · 764 Bytes

Description

Issue

Looks like some hoodlum plumber and his brother has been running around and damaging your stages again.

The pipes connecting your level's stages together need to be fixed before you receive any more complaints.

The pipes are correct when each pipe after the first is 1 more than the previous one.

Task

Given a list of unique numbers sorted in ascending order, return a new list so that the values increment by 1 for each index from the minimum value up to the maximum value (both included).

Example

Input: 1,3,5,6,7,8 Output: 1,2,3,4,5,6,7,8

My Solution

def pipe_fix(nums)
  (nums.first..nums.last).to_a
end