×

# How to minimize a string.Cook 56

 0 http://www.codechef.com/viewsolution/6570234 Can anyone please explain where my solution is failing. I can't figure it out myself. asked 23 Mar '15, 11:57 21●3 accept rate: 0% 0★admin ♦♦ 19.8k●350●498●541 what error are you getting ? (23 Mar '15, 12:00) arun_as1★ Dont know.. I am checking my solution with some testcases and also the AC solutions.Both are giving same result.Still WA. :( (23 Mar '15, 12:14)

 3 You are getting wrong answers for these test cases 5 AABAA correct ans = AAAAB 6 ABCDE correct ans = ABCDE 3 BAA correct ans = AAB 5 ADBCD correct ans = ABCDD See here. answered 23 Mar '15, 12:30 838●3●5●15 accept rate: 20% Thanks a lot.I was not considering this testcases. :) @shivam217 (23 Mar '15, 22:20) 1 your welcome :) (23 Mar '15, 23:39)
 1 For the case : 5 ADBCD correct ans should be ABDCD answered 23 Mar '15, 23:50 13●1●4 accept rate: 0% bro, if we pick "D" and move it last position then we will get "ABCDD" and "ABCDD" is lexicographically smaller than "ABDCD" . (24 Mar '15, 00:00) oh yes....sorry my bad (24 Mar '15, 00:26)
 0 for the test case DABC your code will give ans ADBC but the correct ans would be ABCD (by moving D to the end) answered 24 Mar '15, 02:13 3★sharru05 559●1●7●23 accept rate: 14%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×643
×28
×9

question asked: 23 Mar '15, 11:57

question was seen: 1,421 times

last updated: 24 Mar '15, 13:50