Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int keyScore(String[] key, String[] answers)
- {
- int score = 0;
- for(int i = 0; i < key.length; i++)
- {
- if(key[i].equals(answers[i]))
- {
- score += 3;
- } else if(answers[i].equals("_")) {
- score += 0;
- } else {
- score -= 1;
- }
- }
- return score;
- }
Add Comment
Please, Sign In to add comment