You are not logged in. Please login at www.codechef.com to post your questions!

×

# CodeJam Practice

 2 Question link : https://code.google.com/codejam/contest/4304486/dashboard Somebody please explain me what they mean by in the problem statement ' The contestant wins the game if their last word is the last of an alphabetically sorted list of all of the possible last words that could have been produced. ' Explain it with the example of a testcase from the problem itself. Thanks in advance. :) asked 15 Nov '16, 09:43 4★rdrsadhu 134●8 accept rate: 11%

One Answer:
 2 Suppose, ABC is input, you have to write input letter by letter so, first you will write A and then you have to add B, you can add B either on left side of A(i.e., BA) or on right side of A(i.e., AB), then you have to add C which can be added as following either left of BA(i.e., CBA), right of BA(i.e., BAC), left of AB(i.e., CAB) or right of AB(i.e., ABC). Out of all these combinations(CBA, BAC, CAB, ABC), CBA is the last word in alphabetically sorted list of all the possible combinations. answered 15 Nov '16, 11:01 5★srd091 1.6k●1●11 accept rate: 42% 2 Thanks @srd091 (15 Nov '16, 23:06) rdrsadhu4★
 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• link:[text](http://url.com/ "title")
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×2,646
×533
×40
×40
×21

question asked: 15 Nov '16, 09:43

question was seen: 1,614 times

last updated: 15 Nov '16, 23:06