diff --git a/docs/README.md b/docs/README.md index 007869388..1892be02f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ # Codewars Handbook β˜•οΈπŸš€ [![Views statistics +1 πŸ‘€](https://img.shields.io/badge/dynamic/xml?color=success&label=views&query=//*[name()=%27text%27][3]&url=https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FParanoidUser%2Fcodewars-handbook)](https://hits.seeyoufarm.com/api/count/graph/dailyhits.svg?url=https://github.com/ParanoidUser/codewars-handbook) -[![Completed kata πŸ‘Œ](https://img.shields.io/badge/completed%20kata-69.2%25-red.svg)](https://www.codewars.com/kata/search/java?xids=completed) +[![Completed kata πŸ‘Œ](https://img.shields.io/badge/completed%20kata-69.3%25-red.svg)](https://www.codewars.com/kata/search/java?xids=completed) [![CI pipeline πŸ› ](https://img.shields.io/github/actions/workflow/status/ParanoidUser/codewars-handbook/build.yml?branch=main)](https://github.com/ParanoidUser/codewars-handbook/actions/workflows/build.yml) [![Quality gate πŸ”Ž](https://img.shields.io/sonar/alert_status/codewars-handbook?server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/dashboard?id=codewars-handbook) [![Let's have a chat! πŸ“ž](https://img.shields.io/gitter/room/ParanoidUser/codewars-handbook?color=49c39e)](https://gitter.im/ParanoidUser/codewars-handbook) @@ -25,7 +25,7 @@ slug. | [1 kyu](/kata/1-kyu/index.md) | [2 kyu](/kata/2-kyu/index.md) | [3 kyu](/kata/3-kyu/index.md) | [4 kyu](/kata/4-kyu/index.md) | [5 kyu](/kata/5-kyu/index.md) | [6 kyu](/kata/6-kyu/index.md) | [7 kyu](/kata/7-kyu/index.md) | [8 kyu](/kata/8-kyu/index.md) | [beta](/kata/beta/index.md) | [retired](/kata/retired/index.md) | |:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:---------------------------:|:---------------------------------:| -| 0 | 1 | 2 | 26 | 48 | 440 | 603 | 226 | 56 | 82 | +| 0 | 1 | 2 | 26 | 48 | 440 | 604 | 226 | 56 | 82 | **Note:** The source code is written in Java 17 and may use language features that are incompatible with Java 8, 11. diff --git a/kata/7-kyu/cyrillic-letters/README.md b/kata/7-kyu/cyrillic-letters/README.md new file mode 100644 index 000000000..566a86b20 --- /dev/null +++ b/kata/7-kyu/cyrillic-letters/README.md @@ -0,0 +1,38 @@ +# [Cyrillic letters](https://www.codewars.com/kata/cyrillic-letters "https://www.codewars.com/kata/66d85e2db4d3909a8d0b53c9") + +Cyrillic letters, used in languages like Russian and Ukrainian, have different Unicode values than Latin letters. 2 of those cyrillic +letters include `Π°` and `Ρƒ` which, if you copy these 2, are not the same as the latin `a` and `y` + +Don't believe me? + +### Latin `a`: + +The latin a +End result of latin a + +### Cyrillic `Π°`: + +The cyrillic a +End result of cyrillic a + +## Task + +Your task is to write a function that returns whether a given string is a **Cyrillic letter in the Cyrillic Unicode Block**. + +The string will always be a single letter. + +## Hint + +Here is a link to [Wikipedia's list of the Cyrillic Unicode block](https://en.wikipedia.org/wiki/Cyrillic_(Unicode_block)) for reference + +## Examples + +``` +Input: "D" +Output: false (or False in Python or your language's equivalent) +``` + +``` +Input: "Π―" +Output: true (or True in Python or your language's equivalent) +``` \ No newline at end of file diff --git a/kata/7-kyu/cyrillic-letters/main/Kata.java b/kata/7-kyu/cyrillic-letters/main/Kata.java new file mode 100644 index 000000000..c61722efa --- /dev/null +++ b/kata/7-kyu/cyrillic-letters/main/Kata.java @@ -0,0 +1,7 @@ +import static java.lang.Character.UnicodeBlock.*; + +interface Kata { + static boolean isCyrillic(char letter) { + return of(letter).equals(CYRILLIC); + } +} \ No newline at end of file diff --git a/kata/7-kyu/cyrillic-letters/test/SampleTests.java b/kata/7-kyu/cyrillic-letters/test/SampleTests.java new file mode 100644 index 000000000..86a82796b --- /dev/null +++ b/kata/7-kyu/cyrillic-letters/test/SampleTests.java @@ -0,0 +1,19 @@ +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class SampleTests { + @ParameterizedTest + @ValueSource(chars = {'Π”', 'Π°', 'ΣΏ', 'Π€'}) + void cyrillic(char letter) { + assertTrue(Kata.isCyrillic(letter)); + } + + @ParameterizedTest + @ValueSource(chars = {'D', 'a', 'ΟΏ', 'Τ€'}) + void negative(char letter) { + assertFalse(Kata.isCyrillic(letter)); + } +} \ No newline at end of file diff --git a/kata/7-kyu/index.md b/kata/7-kyu/index.md index d8f85d4cf..e08ccc31c 100644 --- a/kata/7-kyu/index.md +++ b/kata/7-kyu/index.md @@ -126,6 +126,7 @@ - [Curing Arachnophobia](curing-arachnophobia) - [Currying functions: multiply all elements in an array](currying-functions-multiply-all-elements-in-an-array) - [Cyclops numbers](cyclops-numbers) +- [Cyrillic letters](cyrillic-letters) # D - [Day of the Year](day-of-the-year) - [Debug Sum of Digits of a Number](debug-sum-of-digits-of-a-number)