Moorbles
first solution idea:
Use next_permutation or just do recursion to create all the possible combos
Sort the combos in increasing lexicographical order
For each combo:
Loop through all the turns:
For each turn, choose the highest number that is of the opposite type as the current in the combo
second solution idea:
Pre-identify for each turn what happens if you say even/odd (remember that you will gain if there is all of a certain kind and you choose that)
Loop thru and do the best case scenario to see if it is possible (whatever gives you least loss/highest gain)
If it is possible, loop through:
as long as doing an even won't lead to immediate death, do an even else do an odd
Last updated