Skip to content

Commit 6804cbc

Browse files
authored
Resuming work on the repository (#109)
* useless folders removed * update gitignore * added comments to missing files
1 parent e57a888 commit 6804cbc

File tree

10 files changed

+14
-71
lines changed

10 files changed

+14
-71
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DS_Store
2-
.idea/shelf
2+
/.idea/
33
/android.tests.dependencies
44
/confluence/target
55
/dependencies/repo
@@ -29,4 +29,4 @@ node_modules/
2929
.rpt2_cache/
3030
libraries/tools/kotlin-test-nodejs-runner/lib/
3131
.idea/jarRepositories.xml
32-
.idea/misc.xml
32+
.idea/misc.xml

.idea/codeStyles/Project.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.idea/encodings.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/kotlin/dynamicProgramming/Factorial.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package dynamicProgramming
22

3+
/**
4+
* This is a tail-recursive implementation of factorial calculation.
5+
* @param n - the number to calculate factorial for
6+
* @param accumulator - accumulates the factorial value (default is 1)
7+
* @return factorial of the input number
8+
*/
39
tailrec fun factorial(n: Int, accumulator: Int = 1): Int {
410
if (n == 0) {
511
return accumulator
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
package dynamicProgramming
22

3-
fun Int.isPrime() = this > 1 && (2..(this / 2)).all { this % it != 0 }
3+
/**
4+
* Extension function that checks if an integer is a prime number.
5+
* A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
6+
* @return true if the number is prime, false otherwise
7+
*/
8+
fun Int.isPrime() = this > 1 && (2..(this / 2)).all { this % it != 0 }

src/main/kotlin/other/Palindrome.kt

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)