Implement an algorithm in Ruby that removes the elements that
are in matrix A that are corresponding with other matrices
Input
MatrixA = 'whiteblueyellowgreenpurplewhiteyellow'
MatrixB = 'blue'
MatrixC = 'white'
Output
Result = 'yellowgreenpurpleyellow'
Answer :
Algorithm :
MatrixA = 'whiteblueyellowgreenpurplewhiteyellow'
MatrixB = 'blue'
MatrixC = 'white'
puts MatrixA.gsub(MatrixB, '').gsub(MatrixC, '')
Below you can see the program and output :
Get Answers For Free
Most questions answered within 1 hours.