Shehbaz Sharif has been sworn in as Pakistan’s prime minister almost one month after coming second to independent candidates in a controversial election.