Roku interview question

Implement a wordranker. It is easy to implement in Python. But it has to be implemented by Java.