From ad12d24c018b3abe37088ded21786e40911bf6ba Mon Sep 17 00:00:00 2001 From: TalalObaidallah Date: Tue, 8 Mar 2022 16:39:55 +0300 Subject: [PATCH 1/2] Talal Done --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index debb56b..b8d7be6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,26 @@ Create a function that receives an integers array and returns the number that ap | (1,1,2) | 2 | | (2,2,1) | 1 | +var array1:[Int] = [2,4,6,4,9,6,2] +var array2: [Int] = [1,1,2] +var array3: [Int] = [2,2,1] + +for (index, value) in array1.enumerated(){ + print("Index \(index) , value \(value)") +} +print(array1 [4]) + +for (index, value) in array2.enumerated(){ + print("Index \(index) , value \(value)") +} +print(array2 [2]) + +for (index, value) in array3.enumerated(){ + print("Index \(index) , value \(value)") +} +print(array3 [2]) +------------------------------------------- ## 2nd Challenge Create a function that receives a string then it converts uppercase letters into lowercase and vice versa. The function then should print the converted value. @@ -22,6 +41,20 @@ Create a function that receives a string then it converts uppercase letters into | sHroog | ShROOG | +var hello1 = ["hELLO"] +var Hi1 = ["hI"] +var HelloWorld = ["hELLO wORLD"] + +for letterr in hello1 { + print(letterr) +} +for letterr2 in Hi1 { + print(letterr2) +} +for letterr3 in HelloWorld { + print(letterr3) +} + ## 3rd Challenge Create a function that receives an array of items & arrays and returns one flattened array with all items exluding null values. From 9c188567efeb4024f37f3cd739997af4f1f4a90d Mon Sep 17 00:00:00 2001 From: TalalObaidallah Date: Tue, 8 Mar 2022 16:43:36 +0300 Subject: [PATCH 2/2] Done --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8d7be6..ab7bd0b 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ for letterr2 in Hi1 { for letterr3 in HelloWorld { print(letterr3) } - +--------------------------- ## 3rd Challenge Create a function that receives an array of items & arrays and returns one flattened array with all items exluding null values.