On the Subject of Colors Maximization
Can't figure out how to solve it mathematically? Just calculate all possible combinations, there are very few of them, I promise...
Module consists of 20 colored buttons and the "SUBMIT" button.
Each button has a primary color which can be any of the following: red, green, blue, magenta, yellow, white.
Each button has two states: active and inactive. When button is active, its color is the primary one. When button is inactive, its color is black.
When an active button is pressed, all buttons of the same primary color as the pressed button will be deactivated. When an inactive button is pressed, all buttons of the same primary color as the pressed button will be activated.
Each color has its own score. Any two buttons that have a score difference of 1 must not both be active.* To solve the module, activate the buttons with the maximum possible sum of scores and press "SUBMIT". Submitting an invalid score will cause a strike.
Use table to determine the colors' scores. Use the topmost rule with the passed condition.
|Exactly 4 batteries||1||2||3||4||5||6|
|Exactly 2 unlit indicators||2||1||5||4||3||6|
|Exactly 2 even digits in serial number||3||4||2||5||6||1|
|Serial port is present||4||2||3||1||6||5|
|At least one 2-factor code divisible by 3 or 5||5||4||6||1||2||3|
|None of the above apply||6||5||4||3||2||1|
*If submitted buttons violate this rule but the total score is correct module will be passed.