Maximize sum of non-adjacent values | Samsung Interview Question