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

×

# Need help regarding CHDIGER

 0 I am trying to solve Chef and a Beautiful Digit From March Long challenge. I have tried implementing it but am not able to get why I am getting the wrong answer. I have tried it for many input but I am getting correct for all the input. It would be great if someone could tell me what I am missing. Attached the link to my code. https://ideone.com/e.js/fYgwqO asked 13 Mar, 19:10 2★snami_01 3●1 accept rate: 0%

 0 Dude, The correct output would be 223366 answered 13 Mar, 21:22 1 accept rate: 0%
 0 The correct answer would 223466 only. You are only to append a digit and then remove a digit from any place. So you cannot shift the digits. Thus to have 2nd digit as "2", The first 3 needs to be removed. Also since 4<6 There is no need to remove 4. Thus the minimum number that can be obtained turns out to be 223466. (223366 > 223346, and both 223366 and 223346 cannot be obtained by only appending and removing a digit.) answered 14 Mar, 02:07 31●1 accept rate: 25%
 toggle preview community wiki:
Preview

### Follow this question

By Email:

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

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:

×1,424
×267

question asked: 13 Mar, 19:10

question was seen: 82 times

last updated: 14 Mar, 13:07