Problem Statement
There are several cannons located on a plane. Each cannon is represented as a point, and can shoot in one of four directions: left, right, up or down. Given the coordinates of the cannons, assign a direction to each one such that no cannon shoots another cannon. Cannon A shoots cannon B if and only if B is located on A's line of fire. For example, if cannon A is located at (5,7) and cannon B is located at (9,7), cannon A cannot shoot to the right and cannon B cannot shoot to the left.
You are given the coordinates of the cannons in the
Definition
- Class:
- Cannons
- Method:
- getDirections
- Parameters:
- int[], int[]
- Returns:
- String
- Method signature:
- String getDirections(int[] x, int[] y)
- (be sure your method is public)
Notes
- Cannon A is located to the left(right) of the cannon B if and only if the y coordinates of A and B are equal and the x coordinate of A is less(greater) than the x coordinate of B.
- Cannon A is located to the down(up) of the cannon B if and only if the x coordinates of A and B are equal and the y coordinate of A is less(greater) than the y coordinate of B.
Constraints
- x will contain between 1 and 50 elements, inclusive.
- y will contain between 1 and 50 elements, inclusive.
- x and y will contain the same number of elements.
- Each element of x and y will be between -1000000 and 1000000, inclusive.
- No two cannons will be located in the same point.
Examples
{1,2,2,4}
{2,1,3,2}
Returns: "DDLD"
All cannons except for the third can shoot down. The third cannon can not shoot down, but can shoot right.
{0}
{0}
Returns: "D"
There is only one cannon here, so it can shoot in any direction. 'D' is chosen because it comes first alphabetically.
{999994}
{-1000000}
Returns: "D"
{1}
{1}
Returns: "D"
{3}
{1}
Returns: "D"
{1,2,3,4,5,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11,-999001,-999001}
{0,0,0,0,0,0,0,0,0,0,0,-2,-3,-3,-6,-1,-9,-5,-4,-6,-7,-678,0,-3}
Returns: "UUUUUUUUUURDDDDDDDDDDDLD"
{1,2,3,4,5,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11,-999001,-999001}
{0,0,0,0,0,0,0,0,0,0,0,-2,-3,-3,-6,-1,-9,-5,-4,-6,-7,-678,0,-3}
Returns: "UUUUUUUUUURDDDDDDDDDDDLD"
{392546,-736535,625323,938457,301949,834453,571056,155603,-526778,-92149,178248,915502,-174870,392546,710789,301949,151110,-888601,-92149,-526778,-516666,-526778,834453,155603,301949,834453,-888601,-92149,-917675,-888601,151110,710789,915502,-140818,355192,-230208,-760013,-70787,-760013,-230208,710789,-230208,155603,-736535,625323,-92149,-516666,-140818,-140818}
{647367,-779150,-216183,-11155,-420110,-185946,94681,860394,-51441,-779150,-216183,-420110,81133,-949342,-729330,869760,-216183,-779150,-615665,3247,860394,-779150,-779150,-248390,179917,869760,-920513,-216183,81133,-686114,-729330,-779150,975181,647367,-920513,-949342,-420110,179980,-779150,-216183,94681,179917,397929,975181,-149102,-729330,-248390,975181,94681}
Returns: "RDDDDLDRLDDDDDRLULLLLDDDRRDUDLDDRLDDLDDLRLLLLLDUD"
{226110,629535,817759,-294623,229843,614971,-928813,948477,948477,656837,229843,-496053,-3130,111799,701475,369652,-741867,-996353,-141386,656837,-923014,-172264,817759,502907,502907,498762,704369,614971,971362,-784852,218262,614971,132118,730260,408523,123358,-3130,229843,-518663,-161524,229843,-141386,-784852,-496053,-892158,887847,-518663,534881,80600}
{555309,-477201,-605720,-341979,-148170,-979290,-296056,226665,-148170,794389,-27948,477078,-335390,-477201,555309,586425,155192,-614574,-363964,555309,-377651,-134564,-363964,155192,-247391,-720502,-232514,-943718,-477201,-402982,563055,-109550,-535665,555309,-232514,-363964,516491,478422,-232514,477078,525204,-917930,690351,496981,-363964,-829497,-829497,595183,555309}
Returns: "DDDDDDDLDLLDDDDDDDUDDDRRDDDLDDDLDDDDLLLDLDLLDDDDD"
{453076,179725,-248302,-368281,-368281,-96194,125570,762371,-40730,-96194,-977376,125570,-977376,-96194,113853,508264,179725,64409,179725,-197049,-713341,-97687,709065,914779,179725,280658,125570,64409,113853,-713341,-197049,-197049,-950568,-248302,453076,-197049,-757876,508264,-713341,453076,914779,-767989,-950568,-248302,-767989,-248302}
{423850,996798,-369465,47816,-288893,-369465,-987185,996798,-453825,428585,116650,-288893,831218,-277847,-277847,916904,916904,-277847,-277847,738765,-825772,-714402,-69666,565547,-618659,-714402,-825772,738765,116650,428585,-987185,996798,-964571,-69666,116650,916904,-277847,831218,-277847,-612515,934150,-279606,686365,-618659,738765,428585}
Returns: ""
{-430882,67758,-826820,406628,-878854,-11835,567967,-11835,593177,616993,562642,492745,-865174,740109,67758,562642,-941297,998988,406628,980321,871301,650208,-139486,885884,-865174,778617,67758,-11835,-941297,909308,406628,593177,-605029,973188,192412,871301,778617,885884,406628,909308,650208}
{671697,849710,-572562,-989634,-446238,622829,-471149,570984,-90521,-822691,-753304,-822691,-235472,849710,622829,671697,-736737,-736737,-33687,-170872,-235472,-480268,-471149,-556769,-556769,-572562,-984535,-753304,-822691,-190681,-190681,-822691,-170872,671697,-480268,-471149,-170872,-519564,622829,622829,-572562}
Returns: ""
{-895406,-939127,-108967,-419746,-580789,332903,-990655,236487,606031,606031,750691,760714,-631606,760714,499823,852388,740468,236487,852388,879446,121320,740468,-840666,-774823,-840666,-328965,387265,-252705,-971442,879446,-770380,750691,-328965,972219,740468,336571,62783,-195320,750691,740468,178447,332903,-839840,-839840,852388,-770380,-167668}
{-915371,-960074,-919455,711433,486210,102090,-322890,672135,-154931,529916,-960074,224149,16759,671808,-915371,-832173,819586,-953329,672135,740540,740540,-832173,-154931,671808,-685128,-966447,-2093,224149,387063,517377,-907832,-154931,608858,529916,-291990,-596745,-966447,608858,-2093,-297581,900840,-191411,224149,839434,486210,-966447,-685128}
Returns: "DDDDDLDLDLDDDRDDLDRRDDLDDDDDDDLRLDLDDDRLDDDLRDD"
{271981,240962,-940640,-663462,-383356,-10254,552515,-967149,-230404,271981,-880060,-616346,773871,298997,-967149,628920,-216100,125196,-485297,-880060,-940640,-663462,-69547,-485297,315697,238262,315697,-432004,275155,-230404,298997,-494546,773871,888600,869839,-380530,-616346,-967149,288601,-383356,-494546,-494546,-230404,493051,660671,-494546,869839,298997,660671}
{-362105,-238275,-71121,575462,720622,142284,478854,697942,-135917,652591,-409645,142284,-409645,754468,-701883,-701883,142284,-701883,720622,-135917,-959499,-71121,-362105,-966852,-33404,-959499,-731941,695543,695543,956690,-238275,-135917,450446,-389842,-508307,-238275,-33404,478854,-680442,-421729,-628045,512760,-959499,333631,808428,695543,868733,868733,652591}
Returns: ""
{890680,674943,444630,794355,615444,390958,890680,-385557,607530,-325079,-503844,-486977,-953428,668338,-923356,-486977,-953428,165143,-387889,-73621,-987030,513657,-325079,615444,674943,615444,668338,674943,444630,-750586,-424051,165143,952351,316965,-923356,390958,-987030,-325079,513657,794355,607530,601529,601529,794355,844758,794355,316965,890680}
{-965990,263736,198180,374915,389775,198180,374915,469131,-805695,423311,389775,-839419,-472849,198180,-336187,-965990,339329,-953277,-362291,263736,-403245,960465,248747,198180,-104309,263736,-104309,-362291,774429,389775,-143573,-362291,-122722,960465,655579,155008,-336187,-143573,374915,-965990,-104309,960465,655579,-122722,-839419,-839419,745896,248747}
Returns: ""
{673473,673473,318307,183383,-446692,-615738,161691,-553150,-615738,-626638,-58662,-107284,-58662,871139,-107284,-619622,248424,-335859,673473,183383,-933446,133716,-626638,-906426,248424,232561,451134,539201,-570593,-107284,355808,547758,-107284,-619622,-652630,-972366,451134,-259658,-615738,-335859,-652630,-625651,183383,451134,673473,-649916,-863970,-906426,-570593,133716}
{310945,408868,515431,868290,-869359,310945,-999708,-557109,-937746,-678944,906769,-678944,603589,960637,-937746,-389661,423579,-96602,515431,450452,617663,-96602,-88779,450452,874852,-937746,222878,960637,617663,963910,712103,310945,-468499,-15938,-399058,789899,325735,-229987,-229987,750100,-678944,750100,325735,408868,617663,515722,408868,868290,-389661,-329619}
Returns: "DRDRDLDDDDLRDDDDDDRRDRLDLDDDULDDLLLDRDLRDDDURDDLDD"
{545686,-724567,-724567,545686,212078,625299,-724567,-11999,-513017,-880606,936803,-572229,-572229,-957574,-979456,714826,-126858,814015,-880606,-466799,-11999,-996883,-126858,-979456,-996883,-341770,-466799,936803,-724567,907434,936803,-724567,-466799,12640,936803,212078,714826,975952,-572229,212078,-957574}
{-560322,564523,-560322,29688,930284,-106495,-374592,-560322,-220277,-33072,875403,173380,184484,992662,414051,875403,-958050,-958050,-916118,930284,-33072,-916118,-106495,564523,992662,202315,875403,-644643,29688,29688,-356975,-4798,-356975,202315,-907289,564523,-878482,29688,-459049,-108865,-892879}
Returns: "DUDURDLDDLRLLRDUDDDLRDLLLDLLLDRLDDDRDDDDD"
{816426,-213163,-304286,-980441,-213163,334235,-97857,-566228,-932951,-140169,-10913,-471980,-969791,-213163,264589,-883652,-992232,-140169,-883652,-566228,-140169,816426,-10913,-255077,-969791,-992421,-992421,-19969,-159118,-758634,-932951,816426,-992232,-97857,-159118,-10913,-903835,-255077,-992232,12087,-304286,-97857,-10913,-731883,840280,840280,-140169}
{577580,-469020,-634519,-422361,-795683,-422361,-422361,-925874,-986998,864299,-988576,408427,-317830,-306672,735194,95807,-317830,305898,906572,-634519,-317830,-422361,-422361,873687,-786175,864299,-786175,577580,95807,864299,-134154,305898,-109178,-986998,-134154,-795683,-983337,-795683,-786175,-62966,-825994,577580,735194,-901318,-988576,-422361,-795683}
Returns: ""
{-312226,-922875,-48554,-312226,-899468,954796,511792,912839,-109120,-899468,751157,836879,-934912,-647319,740588,-109120,-508646,511792,751157,114022,993190,-934912,939478,-508646,484101,165398,954796,836879,291711,164299,44280,-748196,-899468,-934912,-481478,-208406,-481478,484101,751157,283884,-48554,574305}
{954631,-980578,-913364,-606020,66248,-359765,134396,40472,-672662,134396,-622163,550202,-431742,882907,40472,-622163,-539840,-649344,-359765,134396,236781,-238853,78153,66248,-672662,-539840,-606020,-436110,-518918,78153,768284,-423968,238174,-781166,-423968,-281539,-436110,-622163,478114,-606020,-649344,618402}
Returns: "LDDDDRRDDLDLLDDLDDLDDLDRDDDDDDDDLDRDDULDLD"
{709897,-799051,-968818,-489757,129591,-48055,-799051,-695278,696491,-176056,-951593,-48055,1952,-108627,-846769,314888,-881975,-655909,750531,-93345,268571,-655909,-337423,-881975,750531,-176056,-541153,-968818,-337423,-943584,-968818,-33620,-846769,-534381,828721,129591,-489757,-364779,-820078,-695278,-33620,-337423,-93345,-534381,302231,-695278}
{-555098,519617,-763513,46396,-381928,-785006,-489146,-808198,46396,-97390,-193394,-97390,-69239,-263329,-555098,-287343,138683,60359,648179,-317829,128216,46396,-959459,-422844,-97390,138683,953968,128216,-785006,-808198,750852,-193394,128216,-489146,-243057,84858,-959459,-210335,437243,-839458,-555098,154196,-839458,-785006,379097,437243}
Returns: ""
{-696555,-316486,415525,-984607,-788419,-240468,40755,692089,510082,444948,40755,731353,444948,692089,-316486,-902226,415525,536851,510082,731353,-233370,692089,444948,-15367,-15367,-468915,510082,-15367,-906623,444948,-984607,708862,415525,-15367,-468915,40755,40755,-902226,50714,-258767,-258767,-468915,444948,50714}
{-608646,-843998,760843,-45440,-534967,-113883,78160,-671519,-244028,-671519,713292,713292,-45440,-906793,388097,-45440,-906793,713292,690911,-814370,-906793,-45440,-814370,690911,-814370,-941823,-843998,-45440,-843998,-168674,-534967,-754983,-244028,-8068,760843,760843,-663099,690911,-974547,-974547,-244028,690911,760843,-754983}
Returns: ""
{-121118,332203,-69593,698972,-228763,324257,-121118,214803,-865440,-922419,-666797,405986,-228763,-69593,-733908,608636,-675122,-474475,-556213,244994,-19710,244994,-590075,-675122,142941,-675122,-683330,-946392,-521999,-675122,538775,-556213,-733908,-865440,332203,142941,-556213,324257,-474475,142941,-946392}
{-912766,3037,-640303,-868449,-961468,227813,-371687,-819223,-640303,775701,-738469,-163736,-2465,-819223,888110,325702,888110,-943849,156890,545326,545326,857789,956961,-622509,748348,-868449,632610,-194992,240103,-57977,775701,775701,-868449,-63143,956961,-38401,-868449,-563276,691284,-2465,-943849}
Returns: "DDRDDLLDDDDDLDLDRDLDDLDLLDDLDLDUDLRDDDLRD"
{222106,171513,793705,51377,-582148,513193,998884,51377,998884,919559,51377,-886101,222106,54506,-230432,171513,171513,54506,-624862,-582148,571252,793705,281210,793705,-931816,-679466,171513,-309463,-596079,-624862,51377,-931816,171513,171513,-931816,793705,-889331,-596079,-596079,281210,793705,-889331}
{-741697,-105061,-773675,136590,-773675,691799,-773675,980196,-82136,-773675,-116591,-741697,-243567,-97559,-444404,43598,-904746,-444404,136590,-904746,980196,-904746,100005,136590,136590,-97559,-973279,-973279,-97559,-105061,-773675,226201,-822837,100005,-82136,-444404,-243567,-822837,136590,-741697,-741697,43598}
Returns: ""
{-521053,717321,853513,-959600,-252616,-666048,-280637,-280637,798135,274953,105637,-394556,105637,-759552,-420889,233633,845161,233633,-307575,845161,105637,-773086,68307,543747,-280637,543747,-923090,442353,149957,-773086,-663015,97029,543747,-119114,-549941,701525,-840767,447423,788366,101768,-939200,-959600,-849667}
{-280587,9947,805297,-393999,-931925,497177,-646907,-402150,-383480,744068,553515,197087,-894233,422502,553515,-120905,744068,-762775,-276074,497177,-814581,-296450,-595106,696453,65112,-619331,-931925,825570,-931925,826671,274082,-296450,-646907,957579,957579,453145,65112,-928761,-646907,873244,-907306,274082,278611}
Returns: "DDDDDDDLDDRDDDDLRDDDLDDLRLDDDLDDDDDDDDDDDLD"
{657509,853679,-312272,-737258,-420809,-102272,951787,853679,657509,853679,130065,951787,425735,-243487,-821732,425735,448495,440698,967284,-431757,425735,951787,668836,489182,967284,448495,-556799,-312272,-347270,-734758,881625,-420809,-62789,-420809,951787,-312272,668836,657509,-737258,-420809,668836,489182,881625,-959209,881625}
{-908299,802807,-777782,-574609,-396242,320952,-524677,824372,-589012,535427,-6183,-396242,-481676,498804,-464075,498804,-464075,-908299,456892,-449066,-40653,-409165,-574609,-574609,-464075,-409165,-409165,-40653,320952,-777782,-396242,-79384,-777782,229075,-6183,470093,-6183,-409165,498804,-777782,-524677,-887025,-6183,-887025,-481676}
Returns: ""
{-389367,408523,817759,-996353,701475,971362,-923014,701475,123358,817759,817759,-389367,-294623,-892158,-389367,-294623,502907,-389367,-294623}
{989497,-377970,-232514,-296056,-377970,690351,-829497,155192,-341979,-402982,-943718,478422,-829497,478422,-917930,155192,-296056,155192,-296056}
Returns: ""
{348525,-317979,843607,-317979,843607,348525,843607,-574576,806458,-574576,806458,843607,-410147}
{-103231,-625872,24758,-483672,-987142,-410087,-625872,-103231,-103231,569858,-483672,569858,569858}
Returns: "UDLLDDRDRLDRD"
{511734,-945999,498160,-575055,948115,498160,-869102,596905,948115,948115,119160,-163947,-575055,-945999,-575055,511734}
{38936,-618890,-841858,-543794,-618890,782633,310962,463948,192333,-6198,-321842,-618890,708520,-130735,-618890,-321842}
Returns: "LDDLDLDDLLDDLLDD"
{-315345,570613,27855,74133,-626366,-315345,-282184,-257071,-626366,521938,-946761,-946761,787950,-946761,-946761}
{393673,-204957,89200,539061,716230,716230,-445150,-964087,-964087,539061,716230,-561251,-204957,-964087,393673}
Returns: "DDDDURDDDDLLDDL"
{-697176,-250895,-256535,193104,-250895,-651517,193104,-128933,762730,-128933,-128933,-68559,764068,-68559,108248,-697176,-651517,693339}
{667696,-471248,-963105,-471248,-527055,-873115,86431,667696,-527055,-873115,-903239,607980,625482,936627,667696,508144,667696,86431}
Returns: "LLDDDDLUDRDDDLDDUD"
{858032,-499777,439622,439622,439622,-553176,90614,858032,227491,858032}
{-801464,-491324,-386607,-801464,-295266,217002,944631,72395,288399,-890587}
Returns: "RDLDLDDLDD"
{126113,126113,-59050,402991,-454005,-875144,-59050,-59050,-59050,-59050,323291,-304299,748941,-454005,323291,-454005,-14418,402991,-623686}
{-512562,-797265,-712992,-398814,895177,-109469,-477411,615483,-75146,-398814,-981140,-477411,-712992,-614591,-89224,-228303,895177,-712992,-797265}
Returns: "LDDRLDRLLLDDDDLLDDD"
{-618169,112523,-907456,-885551,-380937,243101,195856,-921545,782613,5772,-885551,-618169,195856,-849238,-885551,-642506}
{-251375,-137080,-871479,919642,819978,919642,-251375,819978,-110193,-871479,819978,402190,346066,-251375,346066,-706235}
Returns: ""
{-669077,-374193,232735,-637894,579996,306511,596896,-637894,350399,306511,232735,-344955,671574}
{-942634,-930998,-930998,-195163,413472,744679,413472,757146,120728,-700296,-916787,-195163,-700296}
Returns: "DDDDDLDLDDLDD"
{69769,581268,-187249,-975079,310281,581268,-187249,-297355,69769,581268,-330050,-297355,-699482,69769,-581969}
{956434,-311566,-311566,-492945,956434,-101738,-235850,-492945,-492945,69317,-827738,-101738,-235850,539407,539407}
Returns: "LDDDDRRDDLDLDRD"
{-657342,714064,714064,274267,807440,274267,606310,526248,-657342,-707586,870129,189982,389729,-164791,389729,-390709,478101,970306,970306}
{26940,-979820,-340222,-83766,792090,-115977,-957322,792090,443484,-315853,-83766,443484,124171,-907292,-907292,26940,-315853,792090,231778}
Returns: "DDLLDDDDLDDDLDDDDRD"
{758226,-962257,666211,666211,-476162,-916721,666211,-878068,666211,758226,-878068,666211,-476162,758226,-303518,-476162,-916721,-476162}
{-37069,-367028,-965225,-418803,-965225,170958,-367028,-367028,-574879,-418803,170958,418929,-37069,-965225,-367028,-574879,-574879,-2296}
Returns: ""
{-715182,-798610,-875445,30694,-486397,282382,-875445,-191399,-798610,-486397,342063,342063,926737,999133,30694,926737,926737,-191399}
{162794,-386091,172647,-597978,-597978,-597978,-597978,-386091,127453,-386091,172647,346324,711136,983891,517588,-597978,983891,517588}
Returns: "DDLDDDDDLUDLLDRDLL"
{925562,81786,925562,-827792,-660320,4031,-686217,-38177,-686217,925562}
{316020,912104,-550040,860545,-532992,-946610,-48190,523062,-532992,126483}
Returns: "LDDDDDLDDL"
{596893,-169500,-296224,-169500,-282686,-282686,596893,-992221,-55051,611066,-282686,611066,-169500}
{-801838,64930,64930,39197,655881,611405,-164767,-323379,-164767,229711,64930,-801838,-801838}
Returns: "DRDLLLRDDLDDD"
{-17297,16296,-77612,584355,-32898,-77612,-108967,-923840,-252705,334308,217409,-32898,217409,926827,584355,-77612}
{-930470,159693,-678607,377554,496850,80802,606639,499398,387063,-394370,611765,-312840,-312840,606639,387063,-312840}
Returns: "DDDDLLDDDDLDDDRL"
{950335,393394,393394,709736,-348230,410133,-348230,950335,950335,-48996,-48996,801330,410133}
{289766,654674,537419,732468,537419,-518501,479004,537419,956105,1690,595857,624434,479004}
Returns: "DLDDLDDRLDLDR"
{741633,957354,333924,357551,-630478,-623456,-277534,-630478,-559023,275904,-911294,-422498,333924,-204747,-841366,-630478,548721,900079,-204747}
{-191579,-929474,-104705,-291908,87720,152717,-899421,152717,-191579,204301,-191579,-371731,87720,-480210,142975,29366,-377263,-899421,29366}
Returns: "DDDDLDDLDDDDRDDDDDR"
{-394831,-917067,364926,364926,780079,-917067,497164,497164,781052,780079,797195,75581,797195,410061,75581,781052,-394831,-917067,-612411,-917067}
{875769,875769,539377,875769,170209,-526384,-55704,-421287,-778647,-568308,539377,875769,-421287,170209,140834,-526384,-465143,-421287,-568308,-55704}
Returns: "ULDRRDRDDDRUDDDRDLDL"
{-903678,410132,-903678,454945,-185820,484668,-639100,842605,115620,115620,-903678,410132,-639100,-562007,-366533,517085,-903678,-366533}
{-985080,-962671,-947453,-239691,-696287,-985080,-925486,-985080,-654194,-944090,-944090,-239691,-999380,-654194,-356531,-925486,-781099,449400}
Returns: "DDLDDDLDRDLLDDDDLL"
{-3,0,9,0,0}
{0,0,0,7,-4}
Returns: ""
The second cannon is enclosed by the other cannons and cannot shoot in any of the four directions, so the empty string must be returned.
{0,-4,0,5,0,-4}
{0,0,-7,3,3,3}
Returns: "RDDDUL"
{-761813,348943,749420,-444982,993810,-548742,-444982,-761813,993810, 363833,728226,28752,461997,544181,776052,-761813,776052,993810,789745, 75502,348943,449038,158889,-548742,-659628,75502,363833,917729,993810, 158889,776052,728226,367390,-689680,917729,748629,367390,917729,859379, 728226}
{393728,835962,-593971,-593971,-36149,-922640,376562,-368880,-368880, -212107,-368880,-595655,-786227,393728,-463260,763742,790220,63191, -212107,-786227,-805377,-912205,-368880,883897,-912205,803745,63191, 803745,790220,-212107,-593971,939489,-912205,939489,-291544,790220, 795389,835962,795389,763742}
Returns: "LLDDLDLDDDDDDDLLURDDDDDLDLLRRLDRDDDDLRDR"
{1000000,999995,999990,999985,999980,999975,999970,999965,999960,999955,999950,999945,-1000000,-999995,-999990,-999985,-999980,-999975,-999970,-999965,-999960,-999955,-999950,-999945,-999940,1000000,999995,999990,999985,999980,999975,999970,999965,999960,999955,999950,999945,-1000000,-999995,-999990,-999985,-999980,-999975,-999970,-999965,-999960,-999955,-999950,-999945,-999940}
{1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000,-1000000}
Returns: "RUUUUUUUUUUULUUUUUUUUUUUUDDDDDDDDDDDDDDDDDDDDDDDDD"
{-761813, 348943, 749420, -444982, 993810, -548742, -444982, -761813, 993810, 363833, 728226, 28752, 461997, 544181, 776052, -761813, 776052, 993810, 789745, 75502, 348943, 449038, 158889, -548742, -659628, 75502, 363833, 917729, 993810, 158889, 776052, 728226, 367390, -689680, 917729, 748629, 367390, 917729, 859379, 728226 }
{393728, 835962, -593971, -593971, -36149, -922640, 376562, -368880, -368880, -212107, -368880, -595655, -786227, 393728, -463260, 763742, 790220, 63191, -212107, -786227, -805377, -912205, -368880, 883897, -912205, 803745, 63191, 803745, 790220, -212107, -593971, 939489, -912205, 939489, -291544, 790220, 795389, 835962, 795389, 763742 }
Returns: "LLDDLDLDDDDDDDLLURDDDDDLDLLRRLDRDDDDLRDR"
{1 }
{2 }
Returns: "D"
{-3, 0, 9, 0, 0 }
{0, 0, 0, 7, -4 }
Returns: ""