Charles Leclerc felt he struggled in earlier qualifying but managed to turn things around to secure pole position at the Albert Park circuit.