From ea59e7b25f7c435820d4b5a32dd86fcc60eaa511 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 13 Jun 2025 18:56:48 +0530 Subject: [PATCH 1/3] Syncing toml file --- .../practice/flatten-array/.meta/tests.toml | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/exercises/practice/flatten-array/.meta/tests.toml b/exercises/practice/flatten-array/.meta/tests.toml index 99eea4950e..44acf175d2 100644 --- a/exercises/practice/flatten-array/.meta/tests.toml +++ b/exercises/practice/flatten-array/.meta/tests.toml @@ -1,10 +1,23 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. + +[8c71dabd-da60-422d-a290-4a571471fb14] +description = "empty" [d268b919-963c-442d-9f07-82b93f1b518c] description = "no nesting" +[3f15bede-c856-479e-bb71-1684b20c6a30] +description = "flattens a nested array" + [c84440cc-bb3a-48a6-862c-94cf23f2815d] description = "flattens array with just integers present" @@ -14,8 +27,37 @@ description = "5 level nesting" [d572bdba-c127-43ed-bdcd-6222ac83d9f7] description = "6 level nesting" +[0705a8e5-dc86-4cec-8909-150c5e54fa9c] +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" From e907c75640ace22b6f162e6ec39b0e40bc5bab18 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 13 Jun 2025 18:58:35 +0530 Subject: [PATCH 2/3] Updating test file --- .../practice/flatten-array/flatten-array.spec.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/exercises/practice/flatten-array/flatten-array.spec.js b/exercises/practice/flatten-array/flatten-array.spec.js index c9d3b49cbc..c9a3c222cc 100644 --- a/exercises/practice/flatten-array/flatten-array.spec.js +++ b/exercises/practice/flatten-array/flatten-array.spec.js @@ -40,13 +40,21 @@ describe('FlattenArray', () => { expect(flatten([1, 2, null])).toEqual([1, 2]); }); - xtest('6 level nest list with null values', () => { + xtest('consecutive null values at the front of the array are omitted from the final result', () => { + expect(flatten([null, null, 3])).toEqual([3]); + }); + + xtest('consecutive null values in the middle of the array are omitted from the final result', () => { + expect(flatten([1, null, null, 4])).toEqual([1, 4]); + }); + + xtest('6 level nested array with null values', () => { expect(flatten([0, 2, [[2, 3], 8, [[100]], null, [[null]]], -2])).toEqual([ 0, 2, 2, 3, 8, 100, -2, ]); }); - xtest('all values in nested list are null', () => { + xtest('all values in nested array are null', () => { expect( flatten([null, [[[null]]], null, null, [[null, null], null], null]), ).toEqual([]); From 0280683f2c23555b4ad74e070804c645e13b700a Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 13 Jun 2025 18:58:58 +0530 Subject: [PATCH 3/3] Updating the json file --- exercises/practice/flatten-array/.meta/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/practice/flatten-array/.meta/config.json b/exercises/practice/flatten-array/.meta/config.json index 64a2c9f4f5..3f5fbf678f 100644 --- a/exercises/practice/flatten-array/.meta/config.json +++ b/exercises/practice/flatten-array/.meta/config.json @@ -5,6 +5,7 @@ "contributors": [ "ankorGH", "gabriel376", + "jagdish-15", "rchavarria", "SleeplessByte", "tejasbubane",