Company: wayfair_26oct
Difficulty: medium
Discount Tags Problem Description A shop in HackerMall offers discount coupons based on a puzzle. There are n tags, each with a value denoted by val[i]. A customer needs to choose tags in such a way that the sum of values is even. The goal is to find the maximum possible even sum of values of tags that can be chosen. Note: There is at least one tag with an even value. Tags can have positive or negative values. It is possible to choose no tags at all. Complete the function getMaximumEvenSum in the editor with the following parameter: int val[n] : the values of tags Returns: long_int : the maximum even sum of tag values Examples Example 1: Consider val = [2, 3, 6, -5, 10, 1, 1] . Consider some of the following chosen tags and their corresponding sums: Chosen Tags Sum Is sum even? ------------------------------------------------- [2, 3, 6, 10, 1] 23 No [2, 3, 6, -5, 10, 1, 1] 18 Yes [2, 6, 10, 1, 1] 20 Yes [2, 3, 6, 10, 1] 22 Yes Explanation: The tags [2, 3, 6, 10, 1] sum to 22, which is