Just to attract your attention. :cheesy: :lol: :cool: ;)
Here's the problem:
I have this string "flames". Then I get a number from earlier part of myprogram. Let the number be 4. Now 'm' is the 4th character. This should be removed. Then the remaining string is "flaes". Now 'e is the fourth char. This should be removed. Finally only one character remains standing. This character should be displayed.
chound 1 Junior Poster
Recommended Answers
Jump to PostWhat happens when the length of the string is less than the index you're removing from? Show me this hypothetical algorithm to it's logical conclusion. For example, remove 'e'. Then remove 's'. Then what?
Jump to PostThe algorithm you're talking about is called the Josephus problem.
Jump to PostJust to attract your attention. :cheesy: :lol: :cool: ;)
Here's the problem:
I have this string "flames". Then I get a number from earlier part of myprogram. Let the number be 4. Now 'm' is the 4th character. This should be removed. Then the remaining string is "flaes". Now 'e …
Jump to PostI cant believe u r asking for help again after Narue just did the whole thing for u. You know which letter will stand at the end, only thing left for u to do is to display it. May be u should try this
All 14 Replies
Narue 5,707 Bad Cop Team Colleague
chound 1 Junior Poster
Narue 5,707 Bad Cop Team Colleague
chound 1 Junior Poster
Narue 5,707 Bad Cop Team Colleague
chound 1 Junior Poster
Narue 5,707 Bad Cop Team Colleague
chound 1 Junior Poster
Asif_NSU 25 Posting Whiz
chound 1 Junior Poster
Narue 5,707 Bad Cop Team Colleague
chound 1 Junior Poster
Asif_NSU 25 Posting Whiz
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.