×

# Doubt in explaination -ONEKING

 2 What happens if there are many kingdoms within a bigger kingdom say [1,9],[1,4],[5,6],[7,9]?what will be the number of bombs required. 1 bomb or 3 bombs ? asked 05 Jan '15, 18:15 87●2●7 accept rate: 0% 0★admin ♦♦ 19.6k●349●497●539

 3 I think, that problem statement is clear: A kingdom of the form [L, R] can be destroyed completely by placing a bomb at a point x on the real line if L ≤ x ≤ R. so can you destroy [1, 4] and [5, 6] with one bomb? Apply golden rule: Do not assume something not written in problem statement. answered 05 Jan '15, 18:30 16.9k●49●115●225 accept rate: 11% I had similar doubt (except the examples). Thanks you very much @betlista ♦♦ for clearing it up, finally got AC :) . Thanks again. (05 Jan '15, 19:15)
 1 i think the intervals which overlap at some point can be destroyed by 1 bomb but which do not overlap have to be destroyed with another bomb. answered 05 Jan '15, 20:11 1★zebronic 17●4 accept rate: 0%
 0 But can't we destroy all kingdoms with a single bomb by destroying 1st kingdom i.e. [1 to 9] ? And answer of above test case should be 1 .Am i wrong in getting the problem . answered 05 Jan '15, 19:54 15●3 accept rate: 0% Why should it work that way? There's nothing like that written in problem statement, those are separate kingdoms... (05 Jan '15, 20:08)
 0 But 1 to 9 kingdom will be overlapped by all other kingdoms so if we will destroy it all other kingdoms should be destroyed ..... answered 05 Jan '15, 21:00 15●3 accept rate: 0% Back to the basics. Tell me, where you will place the bomb... (05 Jan '15, 21:30)
 0 Try out this simple thing. Draw a real line. Find the overlapping regions. Gives you 3. answered 05 Jan '15, 22:42 553●1●9●22 accept rate: 5%
 0 ofcourse 3 bombs will be required answered 06 Jan '15, 00:59 1 accept rate: 0%
 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:

×294
×33

question asked: 05 Jan '15, 18:15

question was seen: 2,886 times

last updated: 12 Jan '15, 15:12