Skip to content

Commit e184a25

Browse files
authored
Rename Challange (#133)
1 parent d7fc448 commit e184a25

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ multiple times and be persistent over time.
7676
- [Is tolerant palindrome](src/test/kotlin/com/igorwojda/string/ispalindrome/tolerant)
7777
- [Is permutation palindrome](src/test/kotlin/com/igorwojda/string/ispalindrome/permutation)
7878
- [Is anagram](src/test/kotlin/com/igorwojda/string/isanagram)
79-
- [Max occurring char](src/test/kotlin/com/igorwojda/string/maxchar)
79+
- [Max occurring char](src/test/kotlin/com/igorwojda/string/maxoccurringchar)
8080
- [String reverse](src/test/kotlin/com/igorwojda/string/reverse)
8181
- [Find the vowels](src/test/kotlin/com/igorwojda/string/vowels)
8282
- [Int reverse](src/test/kotlin/com/igorwojda/integer/reverse)

misc/ChallengeGroups.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ complexity from `O(n^2)` to `O(n)`.
5353
- [Is anagram](../src/test/kotlin/com/igorwojda/string/isanagram/README.md)
5454
- [Square equals](../src/test/kotlin/com/igorwojda/list/squareequal/README.md)
5555
- [Digit frequency](../src/test/kotlin/com/igorwojda/integer/digitfrequency/README.md)
56-
- [Max occurring char](../src/test/kotlin/com/igorwojda/string/maxchar/README.md)
56+
- [Max occurring char](../src/test/kotlin/com/igorwojda/string/maxoccurringchar/README.md)
5757
- [Get duplicated arguments](../src/test/kotlin/com/igorwojda/string/getduplicatedarguments/README.md)
5858
- [Subtract](../src/test/kotlin/com/igorwojda/list/subtract/README.md)
5959
- [Has repeated char](../src/test/kotlin/com/igorwojda/string/hasrepeatedcharacter/README.md)
@@ -144,7 +144,7 @@ We use sliding window instead of nested loops which decreases complexity from `O
144144
- [Is permutation palindrome](../src/test/kotlin/com/igorwojda/string/ispalindrome/permutation/README.md)
145145
- [Is substring](../src/test/kotlin/com/igorwojda/string/issubstring/README.md)
146146
- [Longest word](../src/test/kotlin/com/igorwojda/string/longestword/README.md)
147-
- [Max occurrent char](../src/test/kotlin/com/igorwojda/string/maxchar/README.md)
147+
- [Max occurring char](../src/test/kotlin/com/igorwojda/string/maxoccurringchar/README.md)
148148
- [Reverse string](../src/test/kotlin/com/igorwojda/string/reverse/README.md)
149149
- [Surrounded letter](../src/test/kotlin/com/igorwojda/string/surroundedletter/README.md)
150150
- [Find the vowels](../src/test/kotlin/com/igorwojda/string/vowels/README.md)

src/test/kotlin/com/igorwojda/list/subtract/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- [Is anagram](../../string/isanagram/README.md)
66
- [Square equals](../squareequal/README.md)
77
- [Digit frequency](../../integer/digitfrequency/README.md)
8-
- [Max occurring char](../../string/maxchar/README.md)
8+
- [Max occurring char](../../string/maxoccurringchar/README.md)
99
- [Get duplicated arguments](../../string/getduplicatedarguments/README.md)
1010

1111
## Instructions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
package com.igorwojda.string.maxchar
1+
package com.igorwojda.string.maxoccurringchar
22

33
import org.amshove.kluent.shouldBeEqualTo
44
import org.junit.jupiter.api.Test
55

6-
private fun maxOccurrentChar(str: String): Char? {
6+
private fun maxOccurringChar(str: String): Char? {
77
TODO("Add your solution here")
88
}
99

1010
private class Test {
1111
@Test
1212
fun `Don't find a char in empty string`() {
13-
maxOccurrentChar("") shouldBeEqualTo null
13+
maxOccurringChar("") shouldBeEqualTo null
1414
}
1515

1616
@Test
1717
fun `Finds char 'a' in string 'a'`() {
18-
maxOccurrentChar("a") shouldBeEqualTo 'a'
18+
maxOccurringChar("a") shouldBeEqualTo 'a'
1919
}
2020

2121
@Test
2222
fun `Finds char 'a' in string 'abcdefghijklmnaaaaa'`() {
23-
maxOccurrentChar("abcdefghijklmnaaaaa") shouldBeEqualTo 'a'
23+
maxOccurringChar("abcdefghijklmnaaaaa") shouldBeEqualTo 'a'
2424
}
2525

2626
@Test
2727
fun `Finds char '1' in string 'ab1c1d1e1f1g1'`() {
28-
maxOccurrentChar("ab1c1d1e1f1g1") shouldBeEqualTo '1'
28+
maxOccurringChar("ab1c1d1e1f1g1") shouldBeEqualTo '1'
2929
}
3030
}

src/test/kotlin/com/igorwojda/string/maxchar/README.md renamed to src/test/kotlin/com/igorwojda/string/maxoccurringchar/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Max occurrent char
1+
# Max occurring char
22

33
## Instructions
44

@@ -9,9 +9,9 @@ Given a string implement a function which returns the character that is most com
99
## Examples
1010

1111
```kotlin
12-
maxChar("abcccccccd") // "c"
12+
maxOccurringChar("abcccccccd") // "c"
1313

14-
maxChar("apple 1231111") // "1"
14+
maxOccurringChar("apple 1231111") // "1"
1515
```
1616

1717
## Hints

src/test/kotlin/com/igorwojda/string/maxchar/Solution.kt renamed to src/test/kotlin/com/igorwojda/string/maxoccurringchar/Solution.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.igorwojda.string.maxchar
1+
package com.igorwojda.string.maxoccurringchar
22

33
// Kotlin idiomatic solution
44
private object Solution1 {
5-
private fun maxOccurrentChar(str: String): Char? {
5+
private fun maxOccurringChar(str: String): Char? {
66
if (str.isBlank()) return null
77

88
return str.toCharArray()
@@ -14,7 +14,7 @@ private object Solution1 {
1414

1515
// Kotlin idiomatic solution
1616
private object Solution2 {
17-
private fun maxOccurrentChar(str: String): Char? {
17+
private fun maxOccurringChar(str: String): Char? {
1818
if (str.isBlank()) return null
1919

2020
return str.toList()
@@ -26,7 +26,7 @@ private object Solution2 {
2626
}
2727

2828
private object Solution3 {
29-
private fun maxOccurrentChar(str: String): Char? {
29+
private fun maxOccurringChar(str: String): Char? {
3030
if (str.isBlank()) return null
3131

3232
val map = mutableMapOf<Char, Int>()
@@ -42,7 +42,7 @@ private object Solution3 {
4242
// Recursive naive approach
4343
// Time complexity: O(n^2)
4444
private object Solution4 {
45-
private fun maxOccurrentChar(str: String): Char? {
45+
private fun maxOccurringChar(str: String): Char? {
4646
if (str.length == 1) {
4747
return str.first()
4848
}

0 commit comments

Comments
 (0)