I have the following problem:
- There is an array that consists of 6 numbers, each two digits at maximum.
- Y is an array whose i th element is the sum of the first i +1 elements of the first array.
- Accept a numerical input via keyboard. If it matches one of the numbers in Y display a message; If not, restart the program.

This is the algorithm that I am thinking:
- Initialize empty array [x] & [y]
- 6.times.map{ Random.rand(1..99) }
- Add numbers using each do?
- Store in array [y ]
- Compare input to == array [y]
- If any instance matches display msg else restart
I would be really grateful for any guidance or help with this problem.
1 Answer