Exact ground state of finite Bose-Einstein condensates on a ring