Malaysia’s prime minister resigns after losing majority in parliament