It's Maria and Georg's wedding day. We watch her walk down the aisle of the magnificent church in a fabulous gown to a rousing organ arrangement and people singing "Maria."
The captain, resplendent in his formal naval duds, waits for her. They join hands and ascend the altar.
Evidently, the "problem like Maria" has been solved. Love was the solution.