DEV Community

loading...

Discussion on: Daily Coding Problem #1

Collapse
chenge profile image
chenge • Edited

arr, sum = [10, 15, 3, 7], 17
(arr.combination 2).any?{ |a| a[0] + a[1] == sum }