CT28374

Ravi's Teal Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the herring shoals of Silverfin close for winter, Ravi must finish the ledgers ledger - one figure at a time. Task: Print the lower median: the element at position floor((n-1)/2) after sorting (so for even n it is the smaller of the two middles). Input format: First line: n. Second line: n integers. Output format: Print the lower median. Constraints: 1 <= n <= 974; -1000000000 <= a[i],x <= 1000000.

Example 1:

Input: 908 -982924371 -364846672 -97266141 -606153131 -597840582 -630883435 -162726137 -832391063 -167028126 -7121507 -173294870 -556369010 -17015135 -298561477 -154424396 -306070037 -246062737 -630646434 -777163112 -704618354 -44013501 -140590512 -65428872 -475644989 -266308050 -787390018 -428924648 -340623011 -902328214 -285178248 -941932414 -527440057 -989313341 -80893739 -883617251 -377025423 -16310287 -102570401 -266158917 -429937441 -877003679 -198218491 -150390778 -403917813 -33146855 -909048053 -9333646 -162224811 -299721993 -934188092 -335029269 -378239162 -72977764 -946558914 -836319599 -622289928 -623434735 -177344376 -780292720 -908280768 -102966665 -324991852 -585983251 -197236185 -473572715 -715754785 -614502037 -900761331 -526688985 -72687127 -898958603 -708757732 -684673186 -57833…
Output: -522499246

Example 2:

Input: 48 -692367280 -116576722 -410850305 -887549777 -882441544 -846182211 -262254488 -108228925 -318849110 -779787810 -708700377 -923568570 -415105747 -620627969 -574975862 -376447392 -663042463 -889920663 -742298485 -262624211 -574672328 -213587533 -765359044 -16931676 -375157668 -185162486 -171129238 -917687646 -446399103 -673367223 -147236704 -535957828 -656255386 -799729022 -779256453 -800606359 -787586115 -168566600 -709034425 -405239841 -504499584 -685538656 -820877785 -234112920 -202288869 -738597610 -739158878 -298293569
Output: -620627969

Example 3:

Input: 372 -794544972 -866932592 -117249047 -788217682 -706240583 -997970365 -78815072 -305894807 -459609033 -900597408 -147489904 -106036636 -993315482 -893128708 -595261760 -650615015 -10347865 -987663442 -108733000 -678755261 -242307578 -150464795 -617442254 -565504581 -10913418 -663032096 -296988058 -958372145 -892550612 -582514842 -621968072 -447666996 -515576210 -722332262 -326953364 -766784511 -859911806 -152884297 -356516566 -837676083 -603080995 -982143662 -212756960 -214728551 -806757795 -775156876 -113643672 -605054640 -729530823 -765990127 -124910447 -819953077 -540954215 -949678852 -345534630 -891957629 -417044868 -888262187 -522534759 -863449669 -381197794 -398140924 -385140237 -653320682 -570143512 -992406266 -847052802 -374831069 -81840998 -533999336 -954921101 -101626416 -4051661…
Output: -522534759

Constraints:

1 <= n <= 974; -1000000000 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Ravi's Teal Ledger - EASY Coding Problem | CodeTikki