167 - The Sultans Successors
Solution Description : Backtracking (8-queen problem) At first find all possible combination of 8-queen using backtracking recursion and store all combination to array. You got 92 combination. For each input find the maximum sum from all combination with given value. For this combination
and for input 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Sum = 4 + 15 + 19 + 32 + 34 + 45 + 48 + 62 = 259 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||