1. Max even sum of a subsequence of length K Given an array of integers A and an integer K, find a subsequence of length K that maximize the sum, which must be even. Return the sum, or -1 if no even sum can be made. Examples: A = [4,2,6,7,8], K = 3, the algorithm should return 18 as 4 + 6 + 8 = 18 A = [5, 5, 2, 4, 3], K = 3, the algorithm should return 14 as 5 + 5 + 4 = 14 感覺是一套貪心題
感覺是一套貪心題