There are many different ways to implement it using complex data structures such as sets, but at the minimum for a simple solution, you should know what a for loop is, what an if statement is, and then there's a beautiful function called "data.count." 