• + 1 comment

    Does anyone know why the “Sample Test Case #2” came up with a minimum cost of 15? I got a smaller value of 9.

    The cities and roads configuration is:

             L=6
            +---+
            | 1 |
            +---+
          /   |   \
         /    |    \
        /R=1  |R=1  \R=1
    +---+   +---+   +---+
    | 2 |   | 3 |   | 4 |
    +---+   +---+   +---+
    

    A library for 6 at city #1 and a road, at the cost of 1, to cities #2, #3, and #4; totaling 9.

    How did they get 15?