Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int count = Integer.parseInt(std.nextLine());
        var meals = IntStream.range(0, count).map(it -> std.nextInt()).boxed();
        var satisfactionLevels = IntStream.range(0, count).map(it -> std.nextInt()).boxed();
        var extraSatisfactionLevels = IntStream.range(0, count - 1).map(it -> std.nextInt()).boxed();

        System.out.println(totalSatisfaction(meals.collect(Collectors.toList()),
                satisfactionLevels.collect(Collectors.toList()),
                extraSatisfactionLevels.collect(Collectors.toList())));
    }

    private static int totalSatisfaction(List<Integer> meals,
                                         List<Integer> levels,
                                         List<Integer> extraLevels) {
        int totalLevel = IntStream.range(0, meals.size())
                .reduce(0, (acc, index) -> {
                    Integer meal = meals.get(index);
                    Integer level = levels.get(meal - 1);
                    acc += level;
                    if (index > 0) {
                        Integer beforeMeal = meals.get(index - 1);
                        if (meal - beforeMeal == 1) {
                            Integer extraLevel = extraLevels.get(beforeMeal - 1);
                            acc += extraLevel;
                        }
                    }

                    return acc;
                });

        return totalLevel;
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
    private static int totalSatisfaction(List<Integer> meals,
                                         ^
  symbol:   class List
  location: class Main
Main.java:15: error: cannot find symbol
                                         List<Integer> levels,
                                         ^
  symbol:   class List
  location: class Main
Main.java:16: error: cannot find symbol
                                         List<Integer> extraLevels) {
                                         ^
  symbol:   class List
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner std = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner std = new Scanner(System.in);
                          ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        var meals = IntStream.range(0, count).map(it -> std.nextInt()).boxed();
                    ^
  symbol:   variable IntStream
  location: class Main
Main.java:6: error: cannot find symbol
        var satisfactionLevels = IntStream.range(0, count).map(it -> std.nextInt()).boxed();
                                 ^
  symbol:   variable IntStream
  location: class Main
Main.java:7: error: cannot find symbol
        var extraSatisfactionLevels = IntStream.range(0, count - 1).map(it -> std.nextInt()).boxed();
                                      ^
  symbol:   variable IntStream
  location: class Main
Main.java:9: error: cannot find symbol
        System.out.println(totalSatisfaction(meals.collect(Collectors.toList()),
                                                           ^
  symbol:   variable Collectors
  location: class Main
Main.java:10: error: cannot find symbol
                satisfactionLevels.collect(Collectors.toList()),
                                           ^
  symbol:   variable Collectors
  location: class Main
Main.java:11: error: cannot find symbol
                extraSatisfactionLevels.collect(Collectors.toList())));
                                                ^
  symbol:   variable Collectors
  location: class Main
Main.java:17: error: cannot find symbol
        int totalLevel = IntStream.range(0, meals.size())
                         ^
  symbol:   variable IntStream
  location: class Main
12 errors