[circular list] Added the purely functional infinite solution based on Brent's algorithm