Majority element code