Autodesk Interview Question

Get the k numbers to get sum