Toggle Challenge
Java
100% Correct Code ✅
TCS CodeVita Zone 2
https://telegram.me/+_hn3cBQVbGliYTI9
import java.util.*;
public class Toggle{
https://telegram.me/PLACEMENTLELO
public static List getPossibleDigits(Map validDigits, String fd) {
List potd = new ArrayList();
for (Map.Entry entry : validDigits.entrySet()) {
int mismatches = 0;
String pattern = entry.getValue();
https://telegram.me/PLACEMENTLELO
for (int i = 0; i < fd.length(); i++) {
if (fd.charAt(i) != pattern.charAt(i)) {
mismatches++;
}
}
https://telegram.me/PLACEMENTLELO
if (mismatches
Java
100% Correct Code ✅
TCS CodeVita Zone 2
https://telegram.me/+_hn3cBQVbGliYTI9
import java.util.*;
public class Toggle{
https://telegram.me/PLACEMENTLELO
public static List getPossibleDigits(Map validDigits, String fd) {
List potd = new ArrayList();
for (Map.Entry entry : validDigits.entrySet()) {
int mismatches = 0;
String pattern = entry.getValue();
https://telegram.me/PLACEMENTLELO
for (int i = 0; i < fd.length(); i++) {
if (fd.charAt(i) != pattern.charAt(i)) {
mismatches++;
}
}
https://telegram.me/PLACEMENTLELO
if (mismatches