CT26343

The crates at Brasshaven

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the old quarter of Brasshaven with crates of crates, and Rekha the accountant must account for every last one. 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 <= 866; values are distinct in [1,n].

Example 1:

Input: 437 273 198 305 213 143 284 64 136 341 201 303 253 324 358 297 140 280 200 215 389 239 421 244 314 350 340 410 263 65 27 282 234 6 81 51 386 415 5 115 259 348 279 322 329 174 87 369 93 179 269 25 148 278 161 38 290 309 422 192 108 228 173 258 164 53 185 66 169 347 138 302 364 170 420 163 42 44 365 119 335 186 12 243 401 407 39 113 177 378 187 171 257 354 139 289 205 92 190 195 96 221 132 29 59 60 430 206 325 94 22 54 429 178 127 249 416 238 98 345 231 408 373 384 344 57 374 299 218 167 255 202 101 197 152 433 295 323 316 405 382 327 175 10 99 214 18 52 300 50 230 46 11 121 75 188 220 146 184 28 437 247 145 21 26 180 150 112 83 402 264 72 71 387 31 375 359 40 47 338 381 49 78 397 125 413 321 376 396 4 133 86 361 392 7 330 88 313 130 292 182 352 248 48 356 380 357 199 281 235 229 388 131 63 …
Output: 85

Example 2:

Input: 477 128 156 352 407 135 395 321 343 131 48 130 160 367 199 387 376 81 320 40 51 257 97 293 423 184 358 455 476 249 252 138 29 46 291 268 82 433 146 335 17 251 253 168 292 468 244 170 171 134 132 393 213 458 210 406 469 414 233 421 461 31 1 169 347 102 452 99 470 23 267 288 392 65 18 332 194 462 263 354 391 344 2 381 331 183 15 307 75 409 380 166 337 63 428 177 47 224 339 219 274 32 94 115 240 312 361 20 62 66 145 276 374 311 319 231 284 466 463 333 278 209 55 467 108 150 189 8 404 383 57 123 43 147 200 410 372 369 324 232 190 27 38 101 182 297 11 424 459 104 477 133 72 362 437 449 359 454 342 7 245 172 442 100 143 3 165 301 246 61 440 366 78 10 58 197 41 22 243 124 80 345 202 411 264 212 76 422 175 69 270 179 370 239 277 87 472 364 275 316 136 193 400 154 429 60 341 415 441 289 93 196 408 …
Output: 216

Example 3:

Input: 191 68 167 107 8 4 25 87 174 20 139 66 72 76 111 118 132 89 45 92 104 134 138 144 56 22 73 135 166 30 69 184 60 155 152 150 65 178 110 143 29 177 130 35 71 156 176 113 115 38 97 19 105 80 98 37 125 188 24 99 43 100 181 171 121 186 91 136 173 5 27 128 131 58 18 117 95 62 50 189 88 36 31 11 46 127 94 13 47 108 120 77 126 63 142 182 57 75 129 48 84 137 147 79 26 67 160 54 151 154 39 165 116 172 96 140 82 159 179 78 52 40 41 81 149 2 33 114 3 7 153 44 15 49 148 16 28 162 158 191 109 10 55 161 42 64 169 141 90 185 124 103 83 101 9 85 59 102 6 17 187 14 122 119 190 183 93 175 70 12 21 180 157 34 146 1 123 23 32 145 86 112 106 170 163 61 74 168 53 51 164
Output: 133

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The crates at Brasshaven - EASY Coding Problem | CodeTikki