title: How many Connections are needed to make every airport connected exercise
body: <p>I've been trying to solve an exercise and I need some help. In the exercise it says an airline wants to reduce its costs by connecting all airports with minimal connections, and you are asked to make a function that returns how many connections are necessary to connect all airports.</p>
  <p>They give you the example below and the matrix that represents the current connections with each row representing an airport, and each element in that array representing its connection to the others (the example should return 1).</p>
  <p>In the image, each number represents an airport, in the matrix the same airport is represented by its index, and each airport is an array representing which other airports it connects to. Flights are bidirectional, so if <code>matrix[0][1]</code> is true, <code>matrix[1][0]</code> will also be true.</p>
  <p>But i can't find a way to do so.</p>
  <p><em>example</em><br />
  <img src="https://i.stack.imgur.com/f3Xkx.png" alt="example-image" /></p>
  <p>The maximum I could accomplish was the code below, but it only checks if every airport is connected. If someone could help me with this i would be very grateful.</p>
  <pre><code>def get_minimum_connections(matrix):
      established_connections = [False] * len(matrix)
      for airport in matrix:
          for index, connection in enumerate(airport):
              if connection:
                  established_connections[index] = True
      return established_connections
  
  
  matrix = [
      [False, True, False, False, True],
      [True, False, False, False, False],
      [False, False, False, True, False],
      [False, False, True, False, False],
      [True, False, False, False, False],
  ]
  
  print(get_minimum_connections(matrix))  # Should Print 1
  </code></pre>