Max Verstappen beat Charles Leclerc by 0.054 seconds to take pole for the Singapore Grand Prix, with Lewis Hamilton third.