GlobalLogic interview question

Write max count using Java8