private static long s0lve(String s) {
        if (s == null || s.length() == 0l)
            return -1;
        String[] a = s.split("\n");
        Map<String, Long> map = new HashMap<>();
        long lastPlayed = 0;
        for (int i = 0; i < a.length; i++) {
            String current = a[i];
            String[] aa = current.split(" ");
            if (aa[0].equals("rcv")) {
                if (Character.isDigit(aa[1].charAt(0)) && Integer.parseInt(aa[1]) != 0) {
                    return lastPlayed;
                } else if (map.get(aa[1]) != 0) {
                    return lastPlayed;
                }
            } else if (aa[0].equals("snd")) {
                if (Character.isAlphabetic(aa[1].charAt(0))) {
                    lastPlayed = map.get(aa[2]);
                } else {
                    lastPlayed = Integer.parseInt(aa[1]);
                }
            } else if (aa[0].equals("set")) {
                if (Character.isAlphabetic(aa[2].charAt(0))) {
                    map.put(aa[1], map.getOrDefault(aa[2], 0l));
                } else {
                    map.put(aa[1], Long.parseLong(aa[2]));
                }
            } else if (aa[0].equals("add")) {
                if (Character.isAlphabetic(aa[2].charAt(0))) {
                    map.put(aa[1], map.get(aa[1]) + map.get(aa[2]));
                } else {
                    map.put(aa[1], map.get(aa[1]) + Long.parseLong(aa[2]));
                }
            } else if (aa[0].equals("mul")) {
                if (Character.isAlphabetic(aa[2].charAt(0))) {
                    map.put(aa[1], map.get(aa[1]) * map.get(aa[2]));
                } else {
                    map.put(aa[1], map.get(aa[1]) * Long.parseLong(aa[2]));
                }
            } else if (aa[0].equals("mod")) {
                if (Character.isAlphabetic(aa[2].charAt(0))) {
                    map.put(aa[1], map.get(aa[1]) % map.get(aa[2]));
                } else {
                    map.put(aa[1], map.get(aa[1]) % Long.parseLong(aa[2]));
                }
            } else if (aa[0].equals("jgz")) {
                if (map.get(aa[1]) <= 0L)
                    continue;
                if (Character.isAlphabetic(aa[2].charAt(0))) {
                    i += map.get(aa[2]);
                } else {
                    i += Integer.parseInt(aa[2]);
                }
                i -= 1;
            }
        }
        return 0;
    }
Why Did you create this class? what does it do?
src/adventofcode/Duet_18.java