Weight Nim with Stacks and each player picks from opposite sides

There n stacks of coins. Each stack contains k_i coins and the coins in a particular stack have distinct values. In each turn, you get to pick one coin from the top of any stack, and your opponent can pick one coin from the bottom of any stack. The person with the highest value of coins wins.

What would be the optimal strategy for this game?

I think it should be some kind of greedy algorithm combined with the opponents response and maybe splitting each stack in half to compare values maybe?