Mamdani's effectiveness as a legislator hinges on his ability to form strategic alliances.