Problem Statement
In this problem we find ourselves in the standard three-dimensional space. We have two space probes. Each of them is capable of flying back and forth arbitrarily, but only along a single straight line. The line for the first probe is determined by the points [x[0],y[0],z[0]] and [x[1],y[1],z[1]]. The line for the second probe is determined by the points [x[2],y[2],z[2]] and [x[3],y[3],z[3]]. The two probes can move independently of each other.
The probes are equipped with powerful scanners to observe planets. Your goal is to scan a mysterious planet Theta, located at [x[4],y[4],z[4]].
The midpoint of the line segment connecting the two probes is called the focus point of their scanners. The precision of scanning decreases with the distance of the scanned object from the focus point. Hence it is crucial to position the probes in such a way that the distance between the focus point of the scanners and the planet Theta is minimized. Compute and return this minimal distance.
Definition
- Class:
- SpaceProbes
- Method:
- focusDistance
- Parameters:
- long[], long[], long[]
- Returns:
- double
- Method signature:
- double focusDistance(long[] x, long[] y, long[] z)
- (be sure your method is public)
Notes
- For the purpose of this problem, the two probes and the planet are points. All three objects may share the same location.
- Your answer will be considered correct if its relative or absolute error is at most 10-6.
Constraints
- x, y and z will have 5 elements each.
- Each element of each of the arrays will be between -1012 and 1012, inclusive.
- The five points [x[i], y[i], z[i]] will be distinct.
Examples
{0,1,2,3,4}
{5,6,7,8,9}
{12,6,4,2,5}
Returns: 0.0
The first probe moves along the line going through points [0,5,12] and [1,6,6], while the second one is on the line through [2,7,4] and [3,8,2]. In an optimal solution, we move the first probe to [-1.5, 3.5, 21] and the second one to [9.5, 14.5, -11]. The focus point will be located at [4,9,5], which coincides with the planet Theta's location. Hence the answer is 0.0.
{2,6,4,5,5}
{-1,7,7,4,7}
{8,8,2,4,2}
Returns: 2.23606797749979
In the optimal solution, the first probe should be located at [14/3, 13/3, 8] and the second probe at [8/3, 11, -2/3]. The focus point is then at [11/3, 23/3, 11/3]. The distance between the focus point and the planet Theta located at [5,7,2] is sqrt( (4/3)^2 + (2/3)^2 + (5/3)^2 ) = sqrt(45/9) = sqrt(5).
{0,-2,1,4,0}
{-1,-999999999998,1,999999999997,0}
{-1,1000000000000,1,-999999999998,-2}
Returns: 0.8660254037861707
{0,0,0,0,0}
{1,2,3,4,5}
{1,4,9,16,25}
Returns: 0.0
{3,-4,-5,-6,3}
{2,1,2,1,2}
{4,3,1,5,6}
Returns: 0.03329635791060134
{2,2,2,2,2}
{3,3,3,4,5}
{1,4,7,-2,0}
Returns: 0.0
{5,2,2,2,35}
{7,2,1,0,-9}
{2,2,5,6,4}
Returns: 29.73722121485791
{4,6,9,12,-6}
{-3,2,5,8,-11}
{0,0,3,3,1}
Returns: 0.5
{1,5,4,-4,2}
{3,2,0,2,5}
{4,2,7,11,6}
Returns: 3.2769033000830583
{0,2,2,4,2}
{0,2,0,2,1}
{1,1,1,1,3}
Returns: 2.0
{0,2,2,4,1}
{0,2,0,2,2}
{1,1,1,1,1}
Returns: 1.4142135623730951
{0,2,2,4,0}
{0,2,0,2,0}
{1,1,1,1,2}
Returns: 1.224744871391589
{0,2,2,4,2}
{0,2,0,2,1}
{1,1,1,1,2}
Returns: 1.0
{0,2,2,4,1}
{0,2,0,2,1}
{1,1,1,1,1}
Returns: 0.7071067811865476
{0,1,0,-1,4}
{0,0,9,9,4}
{0,0,0,0,4}
Returns: 4.031128874149275
Test against people who, in the 1D case, incorrectly construct the line as passing through (A+C)/2 and (B+D)/2, as that is the same point here.
{0,-2,1,4,0}
{-1,-1000000000000,1,1000000000000,0}
{-1,1000000000000,1,-999999999999,0}
Returns: 0.288675134594428
{6, -8, -9, 3, 1}
{-4, -10, -1, -7, 3}
{1, 5, -5, 7, 7}
Returns: 9.130789467865487
{-6, 10, 8, 7, -8}
{-1, -4, -8, 4, 5}
{4, -10, -7, 3, 0}
Returns: 8.503492463540868
{0, 10, -2, -7, 1}
{-6, 6, 9, 8, -8}
{3, -7, 10, 9, 5}
Returns: 8.491302461752397
{-94, 19, -11, -58, 66}
{82, -18, -93, 47, -10}
{-78, -60, 67, -80, -34}
Returns: 46.26120771088258
{34, 89, -85, 95, -80}
{-10, 8, 90, 0, 42}
{-47, 72, 35, 72, -69}
Returns: 2.727684966309196
{-21, 21, -34, 0, -64}
{75, -73, 52, -60, -68}
{21, -16, -75, -91, -16}
Returns: 76.62563700587269
{4415, -435, 6942, -4518, -4627}
{-66, 6237, -5148, 7197, -8369}
{-1798, 7567, -9718, 219, -3622}
Returns: 11364.028541647205
{2376, 1889, -8726, 8829, -5715}
{-7050, -3890, -6984, 2467, -4986}
{4344, 4925, 3739, -2739, -858}
Returns: 5690.844877436935
{-5509, -1565, -6170, 1213, -414}
{805, -2727, -6218, -8085, -2601}
{-9853, 6068, 1861, 6093, 9067}
Returns: 3235.084656785191
{1012195, 3114234, 4550478, -2838066, -1944254}
{-8500478, -8201585, -2181078, 5801506, 9830135}
{-9149587, 1355370, -4603096, 6759117, 9132989}
Returns: 6536221.040672541
{-722014, 2226631, -6390716, 5581566, -7929909}
{1284075, 5559308, 7685412, -122898, -8099857}
{1961063, 7448028, -4956905, -6743536, -8503243}
Returns: 4856323.260853817
{4416017, 326107, 2534620, -9329462, -9970582}
{-760808, -281137, -9979540, -3545508, 3591297}
{3531857, 5704425, -8095757, -398136, -2836463}
Returns: 8460936.197452558
{-771502844998, 902996822620, 37317198846, -177205078255, -427604731386}
{772283566588, -508577767531, -729150915536, -164805652488, -803508610519}
{741883634232, 220301255033, 795594350465, 35856570266, -934403230361}
Returns: 1.1843232530852544E12
{790037955955, 175218764906, 49178441556, 739101193618, 602924409246}
{-885414707102, 589088585904, -416759685311, 226822031441, 920631006500}
{31057907718, -723082751845, -952126375713, -892608145092, -461376865896}
Returns: 4.088335377247422E11
{988460610748, 831671052919, 946613606265, 654235011624, 950666308085}
{-702705505710, 757872121376, -776672912564, -321808320990, -612585950466}
{62162814256, 961326319412, -558026998470, -132519490, -116104090407}
Returns: 3.127950769526655E10
{161573909363, 323060738887, -995979904228, -849543838297, -989285928271}
{-334537442199, -966234442229, -613675115423, -393181917849, -65487424907}
{-524732814382, -354991760448, 45440812519, 6987838316, 23133788253}
Returns: 4.0666898897496716E11
{-990779714214, -20565566997, -94258718798, -535500649605, -739471246355}
{789462026237, 123934898625, -636273777344, 624970803349, -270351862370}
{-370843282047, 934524145795, 575653377199, -518280146638, -898566274581}
Returns: 6.587501060248524E11
{452066881476, -45847066007, -864215121691, -983868303103, 219628825911}
{-42680688779, 9839833490, -172391791879, -148443773230, -388577675459}
{417884438967, -853929047479, 677987748214, 186541163038, -917394827971}
Returns: 3.905255544962377E11
{-521924622083, -425749951512, 692184349300, 537506410841, 933026775634}
{404622379372, -172662816770, -380005771264, 234166005226, 976312473997}
{93063564627, 662006226709, -204797640735, -354432560917, 213772479449}
Returns: 1.0994431547806343E12
{107444589345, -872796885301, 258425628082, -729644466565, 377577367183}
{684974736443, -8997611033, 508668041735, 692478545291, 533157602582}
{813124871701, -100698120391, -709294585136, -159590153231, 34419368768}
Returns: 6.972087060639778E10
{723,-53,522,134,622}
{552,780,-433,-319,60}
{-744,-844,603,553,-70}
Returns: 0.6651220764158822
{-218,-210,769,761,270}
{-531,-41,839,349,-336}
{-209,-727,-775,-257,22}
Returns: 3.6936677372695024
{408,22,311,-268,-219}
{231,-377,117,-795,-742}
{333,801,-197,505,769}
Returns: 3.605309891994234
{-210267,-987807,189544,-587996,-399133}
{612867,851883,225327,464343,538604}
{345012,821404,-883248,-406856,-30923}
Returns: 2.0052957152718798
{-91052,167153,-799901,-541696,-703678}
{-147052,-577766,174287,-256427,444335}
{462375,523229,-401239,-340385,-30281}
Returns: 7.01066527090446
{416421,744761,694408,366068,227066}
{169639,250800,-863619,-944780,-428147}
{-213144,-54843,266422,108121,-131670}
Returns: 7.2346836588605274
{-813795173,-901675063,949607582,773847802,67906204}
{935916163,841096063,755285191,565644991,845600677}
{2414564,322336010,201267517,841110409,101841040}
Returns: 0.6220483470044802
{191412548,25330472,852208937,935249975,355728666}
{-354192358,-453083988,-280040945,-230595130,-416008282}
{-863488304,-185120602,182234594,-156949257,337740847}
Returns: 0.6817046925641028
{634789732,286162252,-97696430,250931050,268546650}
{-545821261,-597735530,-309332636,-257418367,-427576949}
{-238670345,120419163,-220077466,-579166974,-229373906}
Returns: 1.1617873668361616
{-644070473,-505898794,-241611934,311074782,109845516}
{429923693,412993506,-876672177,-944392925,-291094989}
{659506743,481259858,683415372,-29572168,-41526482}
Returns: 3.2731111212458712
{472236428,32902662,-957901882,-79234350,-682166499}
{356104404,121490918,-496113181,-26886209,-304617882}
{-724190293,-293356690,936694379,75027173,537085648}
Returns: 5.702474320675728
{-346360933,326660235,-316883071,19627513,-331621967}
{630529526,19468888,129413970,-176116349,379971693}
{550372520,-67299926,524005324,215169101,537188859}
Returns: 24.01534634089217
{-436964726,-636225216,-356788310,-755309290,-994655050}
{58802770,-216738105,-57309038,-608390788,-825868874}
{-446186227,-351686075,227866252,416866556,174349613}
Returns: 10891.721660318257
{-165128603257,-434193245842,-222846253274,-491910895859,75077214319}
{213507741934,688126689386,-976875606831,-502256659379,-856302879901}
{-608096740843,-622426845969,-308803142300,-323133247426,-444119836446}
Returns: 0.8481210202829673
{73377724070,-39580992596,-570240219936,-626719578269,-304910606266}
{160941463164,-11192240050,-41550600943,-127617452550,-26371420497}
{173973017140,-605928091352,410217086192,20266531946,-97855502580}
Returns: 0.48848231423400856
{857048967127,-137161970885,63171267245,560276736251,957215586192}
{429813720804,-33903737630,-207883952008,23974777209,342823613615}
{-53451995014,23398876596,543079157378,504653721573,206388145377}
Returns: 0.0
{138992909661,626536434819,279835781096,-207707744062,-521900942359}
{-505077792886,125277147210,538152607186,-92202332910,-928995002994}
{485097040645,567993058201,-385160574518,-468056592074,-74375793270}
Returns: 0.66047733150498
{11592097204,-42975694220,-214704938695,-269272730119,-101556420745}
{292739317498,517593338457,133245331210,358099352169,212992324354}
{-551043679685,-938671717081,-136070857197,-523698894593,-343557268440}
Returns: 0.6365993391192911
{-146316261601,185839519999,638290099997,306134318397,578142700797}
{-437872425207,-819354168458,144604220731,526085963982,-528115845489}
{496703055354,631132906372,472510357062,338080506044,619036557227}
Returns: 1.3628197230079535
{730603801988,808752233045,-601931323584,-575881846565,142484670257}
{-101974068535,-460729237003,144182869140,24597812984,-337650768165}
{818471524593,65684910072,248103644166,-2825227341,-219499030140}
Returns: 1.8550280706229767
{-475567386864,-128186461651,-321604669727,25776255486,-51205103086}
{-287925140077,115257955141,386132495541,789315590759,452286772948}
{-11284791785,377976375851,-893455190075,-504194022439,-63108823292}
Returns: 4.085619133978348
{306488388579,648617759661,563359537795,221230166713,434923963188}
{-774956391118,-631752400586,-789687899078,-932891889610,-782322145101}
{-347488709211,-663907264611,323705436235,640123991635,-11891636487}
Returns: 3.2114845286261224
{172125756207,-136205863429,-320226573023,-11894953387,-382382028046}
{119409202854,-326977787346,68377593469,514764583669,-352493592048}
{511980394551,-440178858401,-449819418765,502339834187,-921078765059}
Returns: 8.63735393004479
{-309091489960,486567012906,6964919669,802623422535,644595217723}
{-598699223155,-867698038015,558895915803,289897100943,-288900468536}
{-879794020427,-976626298139,-472780702431,-569612980143,-773119639145}
Returns: 3.7880208992445907
{65643601889,-160608122219,184521375815,-41730348293,181645419888}
{498455122124,929150722324,-189191912347,241503687853,46957704845}
{80405428465,459151100353,574702089481,953447761369,232867341006}
Returns: 11.387663656729204
{61508974359,545836205542,-188675288304,-673002519487,-63583157702}
{763777121169,568431130020,-990281448350,-794935457201,-113252164567}
{-476296742765,-271137147278,257874081331,52714485844,-109211330667}
Returns: 1189.3452329981974
{401553548285,25366516170,-131290380872,244896651243,887505647741}
{856778291882,937606776875,51902060694,-28926424299,292683206499}
{292893242997,302558802275,-790858876396,-800524435674,-268313935550}
Returns: 336.31973016386104
{43269204665,364204726369,-49864048643,271071473061,638573622300}
{11750950616,420352552306,-441040426086,-32438824396,602558464993}
{-449238315514,-682042815909,955229694150,722425193755,-212613311863}
Returns: 1148.297222216961
{798521758402,813085939040,828802684148,843366864786,755405020156}
{849603524724,882490143735,412801574723,445688193734,499655774431}
{681272688079,846102406171,-489296368922,-324466650830,-563330320843}
Returns: 626055.3912770513
{-134542852745,-35929752639,-364875970632,-463489070738,-348321625140}
{466593374444,954833710680,-458970919390,-947211255626,-484429392814}
{375569954940,-133439760476,-544256411411,-35246695995,424666805515}
Returns: 937281.2966503402
{343759127858,722909964242,-893846610367,54030480593,293682668679}
{203087487962,-76204951644,-108363176604,-806594275619,-371576903672}
{831518629692,645334079686,543800242658,78338867643,408381613352}
Returns: 827295.0325719944
{282767885507,45062369976,-152207948106,-389913463637,303665588977}
{58084234366,283511741019,197136897407,422564404060,-97782576936}
{423541826504,-25869122981,-540267857313,-989678806798,391256809434}
Returns: 5.557302994887904E8
{-605825666093,-117327611911,932574925944,444076871762,-812881265199}
{-553559873218,-866838372965,-251558133697,61720366050,224679439036}
{-576642382149,-612121602390,-881554155190,-846074934949,-657514595488}
Returns: 1.1645958576713636E9
{-739894184393,-305946943779,630754711790,196807471176,-487846943332}
{-359725747325,-306545572177,-452811869412,-505992044560,-460382522885}
{417029837215,317655011625,-72231515931,27143309659,270832762277}
Returns: 1.2842206256811497E9
{671712870300,282763124146,-227357396180,-421832269257,413519279298}
{777574309566,366577989616,678663829887,473165669912,927835425704}
{-679402144507,131394954717,-906930131295,-501531581683,-627554897907}
Returns: 3.215896304337462E11
{-516559202363,-490927132640,69357396596,18093257150,-273544872746}
{-678888581938,-958954561635,201780836147,761912795541,-469013109900}
{-101317401151,-240322221354,-343634071839,-65624431433,-150168477583}
Returns: 1.7906080663518707E11
{-868723519885,-391514440190,431809632588,-522608526802,-426473034830}
{-248615142512,-431358657725,165012098848,530499129274,-463321958810}
{-544498792646,-507493309445,134658513672,60647547270,-794263870621}
Returns: 7.48922791943506E11
{-451,-493,43,-465,-239}
{21,207,-893,83,-281}
{41,-487,51,-135,-394}
Returns: 0.0
{309,167,52,-19,-462}
{-935,725,-586,244,112}
{-714,-718,-386,-388,270}
Returns: 998.0816942698726
{127,-81,-391,-633,93}
{82,329,237,371,-31}
{5,-405,-56,-213,258}
Returns: 0.0
{425,-354,-565,-116,-238}
{-247,-731,-727,-403,-558}
{722,329,89,271,306}
Returns: 10.15831627126388
{-710,-11,331,-720,-639}
{-492,-144,-141,-720,-847}
{-432,-396,-276,-296,-290}
Returns: 82.09153527735442
{320811,611754,-137833,-931879,-349993}
{-86993,-570437,209676,132795,-834093}
{-447549,-538074,-224894,262021,80971}
Returns: 0.0
{46006,718290,424760,614137,254312}
{444425,-159566,-14641,-244174,613641}
{595399,-168151,273715,112873,33351}
Returns: 0.0
{-28199,-178685,-253928,-377182,245541}
{-61587,-439315,-628179,223458,-535496}
{-470975,46789,305671,-496811,-186257}
Returns: 0.0
{-393637,-275627,579197,335335,-396248}
{380209,-22216,66239,78699,116085}
{508638,647228,-594390,-268366,709700}
Returns: 1.4058312609462817
{-200451,435769,292148,-549429,-693046}
{272436,29751,185388,203847,359488}
{232086,-538426,-139941,205628,604113}
Returns: 3.0229288528333536
{-104913,45005,705618,603479,-459104}
{221075,532597,-248126,-29677,346443}
{-262495,617044,-908292,-427317,-180079}
Returns: 7.84221493296157
{-380069655,427336032,688620700,166051364,-633503762}
{-169478230,404538335,514745497,294331173,-198553699}
{666857415,257635734,508829517,6441951,28062622}
Returns: 0.0
{-325899255,-182156598,-59698406,-448357447,-837016488}
{-687280127,-71678813,-401637845,-357321095,-313004345}
{155554680,-447557268,-86932314,-205070274,-323208234}
Returns: 0.0
{-685797503,-116182682,-863273641,-244980209,-422456347}
{192923552,282583484,-371551129,906157142,341682461}
{304031161,-597356955,370159869,-135878535,-69749827}
Returns: 0.0
{367456159,508024110,226888208,-3771771,558500034}
{-61727838,-196818353,73362677,257844808,-282517251}
{792943806,867317255,718570357,-26603194,270890603}
Returns: 1.3706170543676417
{170900742,776058204,411072882,526431840,-318897762}
{265491323,585219645,413975972,539701597,71488627}
{277363458,131591930,44887435,-506769106,-128521555}
Returns: 0.8895144764137544
{200695035,635575595,-222070482,917419273,-298588922}
{287850158,-82375928,263036582,-65833544,456420818}
{355470402,-180996292,-856050132,626684064,-183976606}
Returns: 1.1527106383634467
{373831397,811436377,626447729,558820045,-63773590}
{396997771,461203667,173232471,684968967,332791866}
{17908255,337851777,-76302126,432062158,-302035274}
Returns: 4.224359480563519
{128114704,102715424,342077244,247795614,632237627}
{-289885350,-478581621,-368883693,-235036386,118206776}
{-50666204,-41909378,464910500,202743735,954216731}
Returns: 0.8715332784608337
{915670226,258074545,367794588,82812307,455425697}
{-201400202,770309648,-707955047,-23618168,-310991148}
{512958893,765419176,-219041518,78834734,124250705}
Returns: 10.826836715172417
{814063788,65189048,619350606,-309248322,724208056}
{775551865,-397396693,887373002,-983870972,426413360}
{202599381,125677809,-82381383,87217023,325851327}
Returns: 5681.791079095976
{215509818,-408603036,-11031390,-96546609,499807621}
{439945788,-471885414,135505162,-15969813,895123424}
{33269802,-773114628,-10390044,-369922413,774162002}
Returns: 7172.580905985616
{9649339,-8366015,511116983,-375459071,-626191217}
{755457806,-132074076,770675822,300278353,292660443}
{437666225,-267368440,-281364645,624422045,983928977}
Returns: 654.5662040272705
{-313990744774,73988719756,-721631885089,442306508501,93650402740}
{5445036328,101685977629,23211423643,311934247546,-12321343734}
{363877599543,36021254105,336387379640,-647181656674,391367820562}
Returns: 4.3967441985085834E11
{-282914487032,-340172339203,-397430191374,-249380134390,-349983194606}
{295370910113,306509632948,317648355783,211375067992,463362588338}
{-588160670006,-273173982764,41812704478,-707919018624,-348643980593}
Returns: 4442.70295334497
{-588757801808,-375218109932,192333475780,122097374800,903188654006}
{558502720871,405236872282,547931559550,323318367327,312747213766}
{-992254928835,-517726698958,-469003010030,-18836624617,504415293954}
Returns: 6324.909285736298
{-158953872694,-36871750362,218272187704,-133923188812,-97912811520}
{660557775154,272438090054,-308728648684,465991538148,466497932604}
{199804813437,136579119393,24184416049,176970047554,168191966416}
Returns: 2.864835514455998
{-607578891642,-305773127014,-434823113509,-349478918652,-824040461403}
{608888695084,512560072820,923154778588,-212300716452,-430238177691}
{827984375633,248155559792,672390804446,-20486113675,714936273360}
Returns: 11.599585685716132
{480159445203,557390326787,844063535492,939621271727,-993783770604}
{253663438509,495131530972,418026319576,392324582444,-136618256159}
{88587181123,-611921092218,-7759640253,193627510402,-427920957364}
Returns: 5.877640321878839
{327956086169,-329090270377,-368905300234,248326026455,-737243508365}
{-297727886583,-295448980927,98551324409,490272724089,493691082575}
{773626789476,229961783438,72619884405,458942991410,-356554517649}
Returns: 0.40593345606566916
{-56054837153,-345039000427,407634778472,-375252371141,232929326122}
{-196732846085,-375617839519,172434244582,-476457440035,-17847852651}
{-8428309409,-750970330685,448901679169,-94487287349,734113711869}
Returns: 0.5041021549825931
{-35896982043,-740392976720,-649522989895,-433579972794,54973004780}
{-700858286661,-207109544644,-36743905281,-539166735334,-530492647298}
{575474508284,-29539988449,-232899642164,374647086775,372114854570}
Returns: 0.6601010441907063
{715095688881,-498876821103,-974074367478,-657276003228,-569416864150}
{438018731899,625184696989,41904323779,430757905919,-20484331251}
{42961224245,-560810437498,-861130389715,-660917088237,-659873169134}
Returns: 0.0
{-506340867437,-559442925820,-259016818221,-388498145443,-441600203826}
{-716084183416,281746516277,447424915655,-993468283521,4362416172}
{154036275507,-567312152234,-498258028894,417503792534,-303844635207}
Returns: 0.0
{635036338657,417126266619,580737624974,444454427787,335499391768}
{426196130786,-160599959740,34541332607,-209728336198,-503126381461}
{-528245773130,436474811490,-61706080580,428564511610,910924803920}
Returns: 0.0
{0, 0, 0, 0, 1 }
{0, 0, 1, 1, 0 }
{0, 1, 0, 1, 0 }
Returns: 1.118033988749895
{-1000000000000, -1000000000000, -1000000000000, -1000000000000, -999999999999 }
{-1000000000000, 1000000000000, -999999999999, 1000000000000, -999999999998 }
{-1000000000000, 999999999999, -999999999998, 1000000000000, -999999999998 }
Returns: 1.0
{0, 0, 0, 0, 1 }
{0, 0, 2, 2, 1 }
{0, 2, 0, 1, 2 }
Returns: 1.0
{999999999999, 0, 0, 1000000000000, 1000000000000 }
{1, 999999999999, 1000000000000, 1, 1000000000000 }
{999999999999, 0, 0, 1000000000000, 1 }
Returns: 7.071067811858403E11
{0, 0, 0, 0, 1 }
{0, -999999999999, 0, 1, 0 }
{1000000000000, 0, 0, 1, 0 }
Returns: 1.0
{1, 2, 0, 3, 4 }
{0, 0, 0, 0, 0 }
{0, 0, 0, 0, 0 }
Returns: 0.0