#373 Counting Matches in a List of Strings

Companies:
BellIntegrator
Themes:
JavaStreams & LambdasPractice

Implement the countFruit method:

public class Main {
    public static void main(String[] args) {
        List<String> fruits = Arrays.asList("orange", "red apple", "green apple", "orange", "yellow apple", "orange");
    }

    public static long countFruit(String fruit, List<String> fruits) {
        // TODO
    }
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in