I guess the starting point is 0, not 1. On Wed, Nov 30, 2011 at 11:14 PM, Satyajit Bhadange <[email protected]> wrote: > > I have one doubt in josephus problem. > > check the recurrence for general case on wikipedia Josephus Problem > > > f(n,k) = (f(n-1,k) + k) mod n with f(1,k) = 1 > > when i take n = 2 and k = 3,answer i am expecting was 2 but answer is coming > out to be 1. > > Am i doing something wrong or k should be greater than n always ? > > Thanks & Regards, > Satyajit Bhadange > Software Programmer > > Problems & Solutions > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en.
-- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
