A competition between two teams has ended with a winning shot at the buzzer