Using Java Hashmap to Find the Biggest Number in an Array which Occurs the Same times as the Number Itself
Today we'll touch-base on an Interview Question that involves multiple important Java concepts. You deal with Arrays, For loops, If statements, While Statement, Iterators, Java Collections and Function re-usability. So, with one single question, your Interviewer can actually assess your expertise in all these areas! Let's check it out! Today we'll try to find the Biggest Number in an Array, which is occurring the Same number of times as the number itself. So, just being the biggest number is not sufficient! If that was what is asked, you can find the max and/or min number of an array with this article. But this is not the question. In order to qualify for an answer, the number should occur the same number of times as the number itself and be the biggest such number. Quite complicated, we should say! If you follow our blog, we have already published one article on the usage of HashMaps to find if two strings are Anagrams . We'll reuse the Hashmap concept here to seg...