# [K (oK)], <strike>40, 32, 28,</strike> 19 bytes

-13 bytes thanks to ngn!

    {|/+/(prm'x)@''!#x}

[Try it online!][TIO-jptksm5g]

[K (oK)]: https://github.com/JohnEarnest/ok
[TIO-jptksm5g]: https://tio.run/##y9bNz/7/P82qukZfW1@joChXvULTQV1dUbmi9n@agoahgpGCsYKJtYKpggmQYWStYAYUMVcw1PwPAA "K (oK) – Try It Online"
Initial solution:
-

    {|/+/'x./:/:(*t),'/:t:{x~?x}#+!(#x)##*x}

[Try it online!][TIO-jpsdiv8q]

[K (oK)]: https://github.com/JohnEarnest/ok
[TIO-jpsdiv8q]: https://tio.run/##Dcg7DoAgDADQq9R04Kc2IGpSBm/DwuDC0ETx6sj28spyl94zPy85UrISE2tbzayIKz/yXdLQTRrFIFppPYP2EGCDmGCHOBASHGNO8Kb/ "K (oK) – Try It Online"

Note: Doesn't work for the first test case [[1]]

Explanation:
-

`{ }` - function with argument `x`

                                       #     - creata a list
                                   (#x)      - with length number of rows of x
                                        #*x  - of the length of the first row
                                  !          - odometer (ranged permutations)
                                 +           - transpose
                                #            - filter out the rows
                          {x~?x}             - that have duplicates
                        t:                   - save it to t 
                    ,'/:                     - pair up each number in each row with
                (*t)                         - a number from the first row
          x./:/:                             - index x with each of the above
       +/'                                   - find the sum of each row
     |/                                      - reduce by max