• + 0 comments

    If you're going to use a Trainwreck, at least format it more like this:

    Scanner in = new Scanner(System.in);
    List<String> strings = IntStream.range(0,in.nextInt())
        .mapToObj(i -> in.next())
        .collect(Collectors.toList());
    IntStream.range(0, in.nextInt())
        .mapToObj(i -> in.next())  // over here, you can comment individual functions where appropriate.
        .mapToLong(q -> strings.stream()
                   .filter(q::equals)
                   .count())
        .forEach(System.out::println);
    

    The line count metric is such a poor one.