Skip to content

Commit

Permalink
프로그래머스/BruteForce: 모음사전(#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieunnnn committed Jan 10, 2024
1 parent 38f546a commit ada68d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/programmers/algorithmKit/bruteForce/PROB05.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package programmers.algorithmKit.bruteForce;

public class PROB05 {
public int solution(String word) {
int answer = word.length();
String alphabets = "AEIOU";
int[] increaseValues = {781, 156, 31, 6, 1};

for(int i = 0; i < word.length(); i ++) {
answer += increaseValues[i] * alphabets.indexOf(word.charAt(i));
}
return answer;
}
}

0 comments on commit ada68d7

Please sign in to comment.