×

# Pleeeeease tell me what is wrong in this solution

 0 Problem link- Bookshelves The link to my solution- greedy strategy Please tell me a counter case which would fail in my solution. Thanks a lot. asked 28 Aug '17, 21:30 681●12 accept rate: 14% Ok, will see. :D . BTW, what TC's is it failing? All, some , ones with large data? (28 Aug '17, 21:32)

 1 Here- Input 5 1 3 5 2 14 1 7 2 3 10 4 Your Output 21 Expected Output 19  We can get a lower output easily. Exchange 14 in upper shelf with 2 in lower shelf. Now upper shelf has elementts 3,5,2,2,1 - max =5. Skew =19. answered 28 Aug '17, 21:42 15.4k●1●20●66 accept rate: 18% Thanks a lot. I am soooo stupid. I should leave CP. (28 Aug '17, 21:47) How did I miss such an obvious case?? (28 Aug '17, 21:48) Dude, you need to chill. Just thinking too much, on and on and on. Focus on one thing at a time and get it sorted. (28 Aug '17, 22:36) Thanks @vijju123 (07 Oct '17, 15:11)
 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:

×424

question asked: 28 Aug '17, 21:30

question was seen: 353 times

last updated: 08 Oct '17, 12:47