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

×

Wrong answer chef and glove

https://www.codechef.com/viewsolution/18876507 Here is the link of my solution. Please tell me my mistake, where i did it wrong?

asked 12 Jun '18, 07:30

rollingautobot's gravatar image

0★rollingautobot
11
accept rate: 0%

edited 12 Jun '18, 08:49


Your solution does not give newlines between test cases. Also, it doesn't even give the correct answer for the sample test case. You should try walking through the code for each test case, and see where you go wrong.

Also, why use recursion for this input and comparison of arrays? Recursion is usually use when you have 2 or more paths and you need to choose the optimal one between them.

I made some changes to your code (marked //here) and got it accepted.

link

answered 12 Jun '18, 09:56

sharatsachin's gravatar image

5★sharatsachin
112
accept rate: 0%

edited 12 Jun '18, 10:08

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,476
×1,919
×856
×525
×432

question asked: 12 Jun '18, 07:30

question was seen: 102 times

last updated: 12 Jun '18, 10:08