Implement a class to manage a Web Browser History of size N. It needs three methods: a constructor to set the size limit, a visit(url/string) function, and a getHistory() function.
The specific constraint was that if you visit a URL that is already in the history, it should be removed from its current position and re-added as the most recent item. If the history exceeds size N, the oldest entry should be evicted. It effectively functions like an LRU (Least Recently Used) Cache.