Flipkart Interview Question

maximum sum od k elements in an array by taking only corner elements