Question: in Ruby: Write a method contains_pair_product? that takes in an array and a target number. The method should return a boolean indicating whether or not

in Ruby: Write a method contains_pair_product? that takes in an array and a target number.

The method should return a boolean indicating whether or not a pair of elements of the array multiply together to result in the target.

p contains_pair_product?([1, 4, 3, 2], 8) #=> true

p contains_pair_product?([7, 5, 2, 4, 12], 12) #=> false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!