Nepal’s prime minister resigned on Tuesday after nationwide protests over corruption and a government ban on social media left 19 people dead and hundreds injured the previous day.