CT26659

Elio's Coral Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the trading post of Goldmeadow opens only for a perfect tally of vials. Elio means to find out. Task: Print how many array elements are less than or equal to x. Input format: First line: n and x. Second line: n integers. Output format: Print the count of elements <= x. Constraints: 1 <= n <= 836; -1000000000 <= a[i],x <= 1000000.

Example 1:

Input: 421 -927867221 -326051462 -523114075 -563237171 -963375534 -701761624 -557225393 -782725806 -616973079 -710938497 -725745040 -752143756 -154931671 -6294433 -385941014 -885813970 -713238067 -925785494 -150015774 -614841449 -723719571 -620216920 -414986457 -212941954 -199146756 -161629652 -698973220 -528041593 -398788261 -513511051 -670770914 -263027304 -449680200 -811446499 -127526268 -975551567 -906046614 -72222660 -515887271 -95319567 -654031821 -593874459 -196225013 -396289294 -788406499 -981152642 -711379643 -138755160 -105416685 -23472293 -97154555 -399400529 -298937915 -58415223 -647850790 -418069659 -172616376 -287813070 -494963492 -233827978 -296378308 -257231651 -88190431 -860713907 -305655792 -199140263 -350603588 -496465308 -26200507 -422612719 -978809436 -191655117 -528855021 -3…
Output: 32

Example 2:

Input: 369 -702787209 -517930867 -715539871 -900940713 -702360009 -827050476 -154880681 -187189397 -594417613 -703345309 -61061556 -598647068 -329821642 -862225569 -398792071 -176052271 -77572264 -307930629 -937256041 -179301626 -724411897 -385059492 -273424814 -183628862 -268785519 -114063212 -833567646 -409034651 -565835168 -683898116 -945435763 -163109491 -813422068 -842060056 -420157124 -541004328 -554663512 -605272580 -474728645 -825209081 -841395846 -439188355 -55680674 -791140791 -447022819 -916165638 -579601174 -951076867 -596406062 -352087042 -958284816 -914194062 -177048902 -919003896 -93499750 -564690392 -347590810 -91383194 -224885401 -357715690 -809838524 -923891708 -769513797 -918069252 -479691814 -214130645 -443950510 -868383939 -115942907 -465981161 -222398795 -427897393 -85793974…
Output: 106

Example 3:

Input: 234 -6808565 -879136371 -308790393 -492175897 -507521728 -866084226 -419841755 -478936570 -636416780 -986509245 -879144538 -92236964 -559567055 -589791206 -783415188 -631064497 -599644630 -4975178 -563877974 -604636361 -713642062 -212979053 -552270187 -481486991 -100445647 -404659892 -648165878 -967946804 -987009403 -734844611 -339295855 -245088413 -590002370 -275537637 -689981169 -948840548 -118610285 -236530 -412170453 -83748007 -68506604 -17480749 -987212085 -589869762 -287523395 -955284715 -817983569 -267892763 -654817824 -347321770 -479412449 -131226666 -466347630 -149383187 -871667935 -702204245 -976819608 -584696439 -693877065 -871027942 -382920096 -82396710 -16866552 -449699105 -391441397 -506287763 -727165433 -579494472 -787706307 -407867721 -32308273 -900971451 -182592557 -638834…
Output: 232

Constraints:

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

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