Question was similar to this one
https://leetcode.com/discuss/interview-question/381353/Affirm-or-Phone-Screen-or-Letters-appearing-most-number-of-words .
In fact same but instead of a,b,c,d,e it was company names.
I did it where in first loop I keep a list of count of all companies
2nd list I loop through list find count of
each ignore if less that current max Count
add if same as maxCount
clear list,update maxCount and add one company to the list.
After coding he asked for optimization where we dont go through the whole company list twice to find maxCount
. The trick to that is use greedy apporach to keep maxCount as we are adding companies to the list and any time a company's count increases than current max clear the list and start fresh. All within same o(n2) loop. ( I did not get that part.
Have a 2nd phone interview scheduled.