there card arrange row card associate number point the point give integer array cardpointsin step card begin end row you exactly k cardsyour score sum point card takenGiven integer array cardpoint integer k return maximum score obtain Example 1input cardpoint 1234561 k 3output 12Explanation after step score 1 however choose rightmost card maximize total score the optimal strategy card right give final score 1 6 5 12example 2input cardpoint 222 k 2output 4explanation regardless card score 4example 3input cardpoint 9779779 k 7output 55explanation you card your score sum point card Constraints1 cardpointslength 1051 cardpointsi 1041 k cardpointslength