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 diff --git a/README.md b/README.md index debb56b..7a62f9b 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,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):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. @@ -50,4 +69,8 @@ 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) +}