Skip to content

Commit cad2f32

Browse files
authored
Update MonoAlphabetic.java
1 parent 8243b5a commit cad2f32

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/thealgorithms/ciphers/MonoAlphabetic.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ public static String decrypt(String data, String key) {
3030

3131
for (char c : data.toCharArray()) {
3232
if (c >= 'A' && c <= 'Z') {
33-
// Get the index in the key using charToPos
34-
int idx = charToPos(c);
35-
// Find the original character using the index
36-
char originalChar = posToChar(key.indexOf(c));
33+
int idx = charToPos(c);
34+
char originalChar = posToChar(key.indexOf(c));
3735
sb.append(originalChar);
3836
} else {
3937
sb.append(c); // Append non-alphabet characters directly

0 commit comments

Comments
 (0)