So I need a solution for this example without using queue. For example [1, 5, 7, 2, 11, 3, 6, 15, 1, 5, 0, 7, 6, 3] max sum of 4 elements here is 35 [11, 3, 6, 15]. This is