Joseph problem

a circular linklist solution