CT22373

The scrolls at Stormrest

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the cliffside roost of Stormrest with crates of scrolls, and Ranger the quartermaster 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 <= 628; values are distinct in [1,n].

Example 1:

Input: 338 107 302 284 231 43 322 25 278 277 280 196 147 32 326 241 214 135 325 240 77 183 73 104 337 118 169 170 230 122 75 321 120 154 105 234 88 176 228 108 157 149 335 174 172 140 237 257 318 210 292 171 269 59 259 253 12 45 40 251 226 287 233 220 238 41 252 289 3 106 216 53 164 279 329 62 163 4 82 211 198 123 131 168 192 31 275 18 68 288 42 327 200 187 207 151 239 145 144 270 6 47 127 324 247 223 308 193 63 310 130 202 218 205 204 304 199 134 97 33 332 112 244 181 90 9 258 71 39 188 60 11 50 336 296 141 212 129 316 117 178 85 227 328 133 121 286 263 14 150 268 161 265 201 338 139 179 195 243 20 282 267 95 186 146 283 52 209 194 158 334 175 138 64 290 313 215 177 261 78 311 58 48 155 22 70 305 15 17 232 229 1 51 262 2 143 189 185 49 153 24 116 317 101 235 301 248 309 246 87 254 295 297 300 72…
Output: 96

Example 2:

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

Example 3:

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

Constraints:

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

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