CT22582

Jeweler's Closest Pair Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the savanna camp of Amberplain opens only for a perfect tally of vials. Jeweler means to find out. Task: Print the minimum absolute difference between any two array elements. Input format: First line: n (>=2). Second line: n integers. Output format: Print the minimum pairwise absolute difference. Constraints: 2 <= n <= 610; -1000000000 <= a[i] <= 1000.

Example 1:

Input: 539 -308711583 -851780429 -928066393 -698414358 -564776786 -555850660 -91226682 -617669857 -718683826 -771068793 -531902109 -705416848 -683927497 -32575736 -473007610 -792884533 -690768757 -341142826 -109692946 -264486263 -625392352 -802849307 -230711504 -944245401 -663538305 -182892455 -406373000 -566787710 -44474265 -577882124 -852906397 -196712298 -248533544 -59010058 -502292165 -64086163 -514955803 -926222900 -80520739 -325695130 -608420267 -515856355 -595054922 -421199727 -385157384 -239592001 -25530281 -430172675 -497010819 -902092316 -984956393 -69379589 -128035501 -888401237 -193886102 -901757626 -465997381 -116264225 -582947814 -203876939 -684274146 -908066098 -316000895 -166114041 -799315302 -612122870 -96482870 -840992943 -532801649 -957683978 -855627245 -159104211 -771016182 -4…
Output: 532

Example 2:

Input: 419 -955462639 -593351631 -473313558 -962457899 -630331292 -413908223 -784849647 -730883864 -230328485 -869391412 -563612830 -927753537 -827481090 -284426645 -861130858 -468927769 -703704511 -354058342 -825166851 -803370535 -617315090 -740100723 -563751098 -737476226 -870049367 -644403490 -875340505 -988650341 -45216804 -357621670 -972738661 -29207757 -564861972 -567613252 -204284086 -30512534 -801285746 -853765674 -441948617 -884670868 -983635755 -34530133 -339606496 -811444146 -25679455 -322246586 -345150466 -109383479 -592188038 -575006395 -855248227 -865513995 -543404882 -585974200 -396732362 -950732419 -75582786 -728756114 -330804264 -202051670 -35713603 -502803401 -483678866 -388437143 -518254808 -706934153 -435240513 -565746803 -390131656 -340840017 -166657782 -216302982 -289602257 …
Output: 11226

Example 3:

Input: 391 -938079795 -870940077 -644935287 -564406851 -825651202 -609880377 -191997310 -444529614 -592918695 -635181357 -165474349 -593203648 -33765861 -529962015 -675627686 -927734876 -196302937 -471046866 -609219679 -313055842 -163511725 -573256610 -318344129 -46151365 -459443364 -361981816 -46794099 -578652490 -297630379 -172393818 -665721806 -66938846 -914562745 -182065052 -105430455 -56113983 -169291989 -205483246 -41587655 -318415111 -799414652 -641074451 -220214325 -202755248 -997137181 -58125928 -344325778 -914537189 -619125078 -871581384 -227643461 -264837517 -242839782 -660793990 -530886024 -146335995 -473153323 -719185746 -871491976 -835601849 -33980976 -65289906 -992499782 -888059062 -7959544 -695975587 -792415404 -32199766 -745590037 -925185867 -978349672 -38664756 -516519740 -13146…
Output: 749

Constraints:

2 <= n <= 610; -1000000000 <= a[i] <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Jeweler's Closest Pair Ledger - EASY Coding Problem | CodeTikki