Break the problem down to the basics - you need something to loop, something to check equality, something to count - but one thing at a time...write it down, and look at it visually (often time...
Type: Posts; User: copeg
Break the problem down to the basics - you need something to loop, something to check equality, something to count - but one thing at a time...write it down, and look at it visually (often time...
A Map or Set would be perfect for this, but perhaps not the purpose of the question. There are many ways to go about doing this. Write out the problem by hand - you have an array you'd like to loop...