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

×

CodeJam Practice

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

rdrsadhu's gravatar image

4★rdrsadhu
1347
accept rate: 11%


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.

link

answered 15 Nov '16, 11:01

srd091's gravatar image

5★srd091
1.6k111
accept rate: 42%

2

Thanks @srd091

(15 Nov '16, 23:06) rdrsadhu4★
toggle preview
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,535
×503
×40
×37
×21

question asked: 15 Nov '16, 09:43

question was seen: 1,600 times

last updated: 15 Nov '16, 23:06