function score = hw4_problem5(key, answers)
    % Check if both inputs are row vectors of the same length
    if ~isrow(key) || ~isrow(answers)
        score = -1; % Return -1 if either input is not a row vector
        return;
    elseif length(key) ~= length(answers)
        score = -1; % Return -1 if the lengths do not match
        return;
    else
        % Compute the score by comparing key and answers element-wise
        score = sum(key == answers); % Count the number of correct answers
    end
end


