From 50999a33d528eb26c50543afb3b3668609add885 Mon Sep 17 00:00:00 2001 From: abalqahtani <92253040+abalqahtani@users.noreply.github.com> Date: Tue, 8 Mar 2022 14:46:29 +0300 Subject: [PATCH] Update README.md --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index debb56b..40d2d5d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ Create a function that receives an integers array and returns the number that ap | (1,1,2) | 2 | | (2,2,1) | 1 | +var arry1 = [2,4,6,4,9,6,2] +print (9) + + var arry2 = [1,1,2] + print (2) + + var arry3 = [2,2,1] + print(1) ## 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. @@ -21,6 +29,33 @@ Create a function that receives a string then it converts uppercase letters into | My name is Ali | mY NAME IS aLI | | sHroog | ShROOG | +func Hello(x: String){ +} +return +("hello") + +func Hi(x: String){ +} +return("hI") + +func Hello World(x: String){ +} +return("hello") + +func Hello World(x: String){ +} +return +print("hELLO wORLD") + +func My name is Ali(x: String){ +} +print("mY NAME IS aLI") + + +func sHroog(x: String){ +} +return(" ShROOG ") + ## 3rd Challenge Create a function that receives an array of items & arrays and returns one flattened array with all items exluding null values. @@ -32,6 +67,19 @@ Create a function that receives an array of items & arrays and returns one flatt | 3 | [[null, 3], [2, 4, 5, null], 0, 8, 3] | [3, 2, 4, 5, 0, 8, 3] | | 4 | [3, 5, [5, 9, 0]] | [3, 5, 5, 9, 0] | +func arry1 = [1,[2,3,null,4],[null],5] + +return(arry1: Int) + + +var arry2 = [7, 0,[null],[null, null, 9]] +return(arry2: Int) + +var arry3 = [[null, 3], [2, 4, 5, null], 0, 8, 3] +return(arry3: Int) + +var arry3 = {[[null, 3], [2, 4, 5, null], 0, 8, 3] +return(arry3: Int) ## 4th Challenge Create a function that receives a string that contains combination of parentheses, square brackets, and curly braces. Then, it returns true if every opening bracket has a closing pair.