What does IP mean?
DBA
DEG
ADI
FFD
1ST LETTER SUM: 4+4+1+6 = 15
2ND LETTER SUM: 2+5+4+6 = 17
does not met constraint that sum is at least as large
--------------------------------------------------
DEG
ADI
FFD
FDF
1ST LETTER SUM: 4+1+6+6 = 17
2ND LETTER SUM: 5+4+6+4 = 19
does not met constraint that sum is at least as large
---------------------------------------------------
DBA
FFD
FDF
BAI
1ST LETTER SUM: 4+6+6+2 = 18
2ND LETTER SUM: 2+6+6+1 = 15
This combination is acceptable.
---------------------------------------------------
Do not know what IP means or how implemented.
However, a way to solve:
Get ALL combinations of the 8 words taken 4 at a time
& calculate the sum of the 1st letters & 2nd letters:
if the constraint is not met, discard that set.
Of the sets remaining
determine the sum of the 3rd letter and choose the maximum
value.