#83 Counting Sock Pairs by Color

Companies:
Cleverdata
Themes:
JavaStreams & LambdasPractice

Count the number of pairs by color:

public class Main
{
    public static void main(String[] args) {

        // List of sock colors
        List<String> listSocks = Arrays.asList(
            "Red", "Red", "Yellow", "Yellow", "Yellow",
            "Red", "Black", "Black", "Black", "Red"
        );

    //your code
    }
}

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