From bddfd2f3e1dcbb05736e8f4b8eafed386408c9dd Mon Sep 17 00:00:00 2001 From: Rawan Date: Tue, 8 Mar 2022 14:52:02 +0300 Subject: [PATCH 1/4] solve challenge --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index debb56b..2a67d1a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,19 @@ Create a function that receives an integers array and returns the number that ap | (1,1,2) | 2 | | (2,2,1) | 1 | +} +fun num(list:List): Int{ +var num=0 +var dis=0 +for(i in 0..list.size){ +num=list[i] +for(j in i+1..list.size){ +if(list[i]==list[j]){} + + } + +} ## 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. @@ -20,7 +32,10 @@ Create a function that receives a string then it converts uppercase letters into | Hello World | hELLO wORLD | | My name is Ali | mY NAME IS aLI | | sHroog | ShROOG | +fun convert(name:String){ +for(i in 0..name.size){ +} ## 3rd Challenge Create a function that receives an array of items & arrays and returns one flattened array with all items exluding null values. @@ -50,4 +65,7 @@ Create a function that receives a string that contains combination of parenthese | {[}]) | false | - +fun parentheses(parentheses:String):Boolean{ +for(i in 0..parentheses.size){ +if(parentheses) +} From bb00f7b05b70cc48177aec57a1b76b47146a6641 Mon Sep 17 00:00:00 2001 From: Rawan Date: Tue, 8 Mar 2022 15:05:58 +0300 Subject: [PATCH 2/4] solve challenge --- .idea/.gitignore | 3 +++ .idea/coding-challenges.iml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 5 files changed, 32 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/coding-challenges.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/coding-challenges.iml b/.idea/coding-challenges.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/coding-challenges.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1763e15 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..1e88721 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From f1e9996dcebd86dcab7c95321d108665c61c7b26 Mon Sep 17 00:00:00 2001 From: Rawan Date: Tue, 8 Mar 2022 15:18:31 +0300 Subject: [PATCH 3/4] solve challenge2 --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a67d1a..f33a83e 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,14 @@ Create a function that receives a string then it converts uppercase letters into | Hello World | hELLO wORLD | | My name is Ali | mY NAME IS aLI | | sHroog | ShROOG | -fun convert(name:String){ -for(i in 0..name.size){ - +fun convert(name:String):String{ +for(i in 0..name.length){ +if(name[i].isUpperCase()) +{name[i].toLowerCase() +} +name[i].toUpperCase() } +return name}} ## 3rd Challenge Create a function that receives an array of items & arrays and returns one flattened array with all items exluding null values. From 0efb47fc7ab5d8b8c529b0376528fa87d3c77602 Mon Sep 17 00:00:00 2001 From: Rawan Date: Tue, 8 Mar 2022 15:22:14 +0300 Subject: [PATCH 4/4] solve challenge2 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f33a83e..7a62f9b 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,4 @@ fun parentheses(parentheses:String):Boolean{ for(i in 0..parentheses.size){ if(parentheses) } +