prcsamrat's blog

By prcsamrat, history, 14 months ago, In English

Hello, I am trying to solve the Josephus Queries (Mathematics section) problem, and I am not able to code the logic that is iterative and not recursive.

I am really trying hard to get through this problem, I just completed the introduction and graph sections.

Looking forward to help.

Thanks in advance.

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why does it have to be iterative? A recursive solution is probably easier to implement

»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

ordered_set is a cheatcode if u really wanna solve it

  • »
    »
    14 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Can you elaborate a bit more on this? I tried thinking in this way but not able to pick up!

    • »
      »
      »
      14 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Just simulate the process and use ordered ser from gnu pbds