CT22354

Last lanterns of Mina

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Mina runs the ferry office at the glass towers of Prismhaven. Today the books show a list of lanterns, and the numbers must be worked out before sundown. Task: The array contains n-1 distinct integers chosen from 1..n with exactly one missing. Print the missing integer. Input format: First line: n. Second line: n-1 space-separated distinct integers in [1,n]. Output format: Print the missing integer. Constraints: 2 <= n <= 403; values are distinct in [1,n].

Example 1:

Input: 2 1
Output: 2

Example 2:

Input: 15 12 5 1 9 13 7 2 15 11 4 8 6 3 10
Output: 14

Example 3:

Input: 343 177 245 153 299 64 282 307 336 84 38 207 63 332 56 57 203 316 315 143 59 36 40 342 304 79 255 286 302 95 338 77 222 135 152 241 66 101 32 270 128 61 219 145 285 5 238 70 150 193 109 274 121 87 229 321 74 202 181 58 51 291 214 206 140 341 49 277 19 306 268 144 303 288 113 24 45 7 226 189 256 323 234 139 259 126 167 231 52 105 47 218 30 337 221 75 329 318 262 115 123 154 188 225 127 17 82 138 289 228 104 147 129 331 73 308 83 322 208 20 295 273 15 141 76 151 117 146 53 269 89 271 334 16 251 294 312 237 112 93 319 133 236 296 174 37 275 34 27 156 60 328 201 142 263 290 179 31 325 116 96 252 172 220 97 178 68 165 39 187 160 248 163 55 85 197 114 4 170 260 253 134 232 10 26 106 209 301 22 29 215 6 230 311 157 235 281 3 11 42 111 324 246 327 99 149 326 67 35 62 258 264 43 317 320 71 182 8 94…
Output: 161

Constraints:

2 <= n <= 403; values are distinct in [1,n].

Loading...
Test Cases:No test cases
No test cases available.
Last lanterns of Mina - EASY Coding Problem | CodeTikki