Cody

# Problem 2561. expand intervals vol.3

Solution 1940249

Submitted on 17 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
bounds = [1 5 3 9 24 32]; elements = [1 2 3 4 5 6 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

y = 1 2 3 4 5 y = 1 2 3 4 5 y = 1 2 3 4 5 6 7 8 9

Assertion failed.

2   Fail
bounds = [5 1 3 9 32 24]; elements = [1 2 3 4 5 6 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

y = 1 2 3 4 5 y = 1 2 3 4 5 y = 1 2 3 4 5 6 7 8 9

Assertion failed.

3   Fail
bounds = [11 11 9 9]; elements = [9 11]; assert(isequal(ExpandIntervals(bounds),elements))

y = 11 y = 9 10 11

Assertion failed.

4   Fail
bounds = [200 400 300 100]; elements = [100:400]; assert(isequal(ExpandIntervals(bounds),elements))

y = 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 y = 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400

Assertion failed.

5   Fail
temp = [-11:1.1:9; -9:9.5]; bounds = temp(:)'; elements = -11:9; assert(isequal(ExpandIntervals(bounds),elements))

y = -11 -10 -9 y = -11 -10 -9 y = -11 -10 -9 -8 y = -11 -10 -9 -8 y = -11 -10 -9 -8 -7 y = -11 -10 -9 -8 -7 y = -11 -10 -9 -8 -7 -6 y = -11 -10 -9 -8 -7 -6 y = -11 -10 -9 -8 -7 -6 -5 y = -11 -10 -9 -8 -7 -6 -5 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0

Assertion failed.

6   Fail
temp = [-11:1.21:11; -8.7:10]; bounds = temp(:)'; elements = [-11:0, 7:10]; assert(isequal(ExpandIntervals(bounds),elements))

y = -11 -10 -9 y = -11 -10 -9 y = -11 -10 -9 -8 y = -11 -10 -9 -8 y = -11 -10 -9 -8 -7 y = -11 -10 -9 -8 -7 y = -11 -10 -9 -8 -7 -6 y = -11 -10 -9 -8 -7 -6 y = -11 -10 -9 -8 -7 -6 -5 y = -11 -10 -9 -8 -7 -6 -5 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0

Assertion failed.

7   Fail
temp = [-11:2.599:9; -9:2.601:11]; bounds = temp(:)'; elements = [-11:-7, -5:-2, 0:6, 8:9]; assert(isequal(ExpandIntervals(bounds),elements))

y = -11 -10 -9 y = -11 -10 -9 y = -11 -10 -9 -8 -7 y = -11 -10 -9 -8 -7 -6 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 y = -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1

Assertion failed.

8   Fail
bounds = [-10.8 10.9]; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

y = -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10

Assertion failed.

9   Fail
bounds = [10.8 -10.9]; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

y = -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10

Assertion failed.