I am new to programming, so please accept my apologies if this question is simple.
My teacher wants us to create a method that searches a stack for the name that occurs most often and returns it
for example : If I have these names in my stack:
Tiger Woods, Jack Nicholas, Arnold Palmer, Jack Nicholas, Jimmy Demerrit, Jack Nicholas, Sam Sneed, Jimmy Demerrit, Ben Hogan, Walter Hagen, Tommy Armor, Bobby Jones
the method should return Jack Nicholas
Please help me for I need to know how to do it for my program
thank you in advance