Guest User

Untitled

a guest
Dec 11th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. Find the max and min of `sum` of all permutations of [1..9] satisfying the following condition:
  2.  
  3. ```
  4. sum
  5. == a[1] + a[2] + a[3]
  6. == a[3] + a[4] + a[5]
  7. == a[5] + a[6] + a[7]
  8. == a[7] + a[8]
  9. where sum = a[0] + a[1]
  10. ```
  11.  
  12. A permutation satisfying that condition is `a = [9,4,1,8,3,2,5,6,7]`, and sum is `13`.
Add Comment
Please, Sign In to add comment