Skip to content

Updating test.toml for Flatten-Array #2928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions exercises/practice/flatten-array/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Instructions append

For the Java track, the input will be provided as a `List` instead of an array, and the output should also be a `List`.
15 changes: 10 additions & 5 deletions exercises/practice/flatten-array/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Instructions

Take a nested list and return a single flattened list with all values except nil/null.
Take a nested array of any depth and return a fully flattened array.

The challenge is to take an arbitrarily-deep nested list-like structure and produce a flattened structure without any nil/null values.
Note that some language tracks may include null-like values in the input array, and the way these values are represented varies by track.
Such values should be excluded from the flattened array.

For example:
Additionally, the input may be of a different data type and contain different types, depending on the track.

input: [1,[2,3,null,4],[null],5]
Check the test suite for details.

output: [1,2,3,4,5]
## Example

input: `[1, [2, 6, null], [[null, [4]], 5]]`

output: `[1, 2, 6, 4, 5]`
7 changes: 7 additions & 0 deletions exercises/practice/flatten-array/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Introduction

A shipment of emergency supplies has arrived, but there's a problem.
To protect from damage, the items — flashlights, first-aid kits, blankets — are packed inside boxes, and some of those boxes are nested several layers deep inside other boxes!

To be prepared for an emergency, everything must be easily accessible in one box.
Can you unpack all the supplies and place them into a single box, so they're ready when needed most?
20 changes: 20 additions & 0 deletions exercises/practice/flatten-array/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,32 @@ description = "null values are omitted from the final result"

[c6cf26de-8ccd-4410-84bd-b9efd88fd2bc]
description = "consecutive null values at the front of the list are omitted from the final result"
include = false

[bc72da10-5f55-4ada-baf3-50e4da02ec8e]
description = "consecutive null values at the front of the array are omitted from the final result"
reimplements = "c6cf26de-8ccd-4410-84bd-b9efd88fd2bc"

[382c5242-587e-4577-b8ce-a5fb51e385a1]
description = "consecutive null values in the middle of the list are omitted from the final result"
include = false

[6991836d-0d9b-4703-80a0-3f1f23eb5981]
description = "consecutive null values in the middle of the array are omitted from the final result"
reimplements = "382c5242-587e-4577-b8ce-a5fb51e385a1"

[ef1d4790-1b1e-4939-a179-51ace0829dbd]
description = "6 level nest list with null values"
include = false

[dc90a09c-5376-449c-a7b3-c2d20d540069]
description = "6 level nested array with null values"
reimplements = "ef1d4790-1b1e-4939-a179-51ace0829dbd"

[85721643-705a-4150-93ab-7ae398e2942d]
description = "all values in nested list are null"
include = false

[51f5d9af-8f7f-4fb5-a156-69e8282cb275]
description = "all values in nested array are null"
reimplements = "85721643-705a-4150-93ab-7ae398e2942d"