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

×

What should be the answer of this testcase(very small) of hackerrank problem "Equal"?

Here is the link to the problem: https://www.hackerrank.com/challenges/equal

1
3
1 5 5

Won't the answer of this testcase be 4? The correct answer is 3 but how?

asked 29 Nov '16, 20:20

kartik3390's gravatar image

2★kartik3390
173
accept rate: 0%

edited 29 Nov '16, 20:22


First she chooses colleague 1 and gives 1 chocolate each to colleague 2 and 3.

So now it is 1 6 6.

Next she chooses colleague 2 and gives 5 chocolates to 1 and 3.Now it is :

6 6 11.

At last colleague 3 is chosen and 5 chocolates to 1 and 2 make it:

11 11 11.

Hence answer is 3.

link

answered 29 Nov '16, 21:14

sdssudhu's gravatar image

6★sdssudhu
1.1k310
accept rate: 15%

Yeah, that's it. Thanks :)

(29 Nov '16, 21:50) kartik33902★
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:

×1,657
×361
×310

question asked: 29 Nov '16, 20:20

question was seen: 657 times

last updated: 29 Nov '16, 21:50