about | help | code help+videos | done | prefs |
Write a method called "swapMeet" that accepts two integer arrays as input parameters. The first array contains the dollar values of all the items you are considering swapping out. The second array contains the dollar values of all the items you are hoping to get in the swap. A swap is considered "good" if the total value of the items you get is greater than the total value of the items you swapped away. Return true if the swap is "good", return false otherwise. Note that all items being swapped will be worth at least one dollar. swapMeet([4, 23, 7, 1], [6, 3]) → false swapMeet([14, 2, 3, 4, 5, 4, 3, 2, 2], [400]) → true swapMeet([104, 324, 423], [880]) → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 380
Copyright Nick Parlante 2017 - privacy