Skip to content

Commit 7d74f9e

Browse files
docs: Readme
Update readmes
1 parent 45b9e13 commit 7d74f9e

File tree

97 files changed

+3767
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3767
-261
lines changed

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage
2+
dist
3+
node_modules

CODE_OF_CONDUCT.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

kata/5 kyu/is-my-friend-cheating/readme.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@
55
- He says that the product of a and b should be equal to the sum of all numbers in the sequence, excluding a and b.
66
- Given a number n, could you tell me the numbers he excluded from the sequence?
77

8-
The function takes the parameter: `n` (n is always strictly greater than 0) and returns an array or a string (depending on the language) of the form:
8+
The function takes the parameter: `n`
9+
(n is always strictly greater than 0) and returns an array or a string (depending on the language) of the form:
910

1011
```
1112
[(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or or [{a, b}, ...]
1213
```
1314

14-
with all `(a, b)` which are the possible removed numbers in the sequence `1 to n`.
15+
with **all** `(a, b)` which are the possible removed numbers in the sequence `1 to n`.
1516

16-
`[(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or ...` will be sorted in increasing order of the "a".
17+
`[(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or ...`will be sorted in increasing order of the "a".
1718

18-
It happens that there are several possible (a, b). The function returns an empty array (or an empty string) if no possible numbers are found which will prove that my friend has not told the truth! (Go: in this case return `nil`).
19+
It happens that there are several possible (a, b).
20+
The function returns an empty array (or an empty string) if no possible numbers are found which will prove that my friend has not told the truth! (Go: in this case return `nil`).
1921

2022
(See examples of returns for each language in "RUN SAMPLE TESTS")
2123

22-
## Examples:
24+
# Examples:
2325

2426
```
2527
removNb(26) should return [(15, 21), (21, 15)]
@@ -56,3 +58,15 @@ in C:
5658
removNb(26) should return **an array of pairs {{15, 21}{21, 15}}**
5759
tested by way of strings.
5860
```
61+
62+
---
63+
64+
## Tags
65+
66+
- Algorithms
67+
- Data Types
68+
- Fundamentals
69+
- Logic
70+
- Mathematics
71+
- Numbers
72+
- Puzzles

kata/5 kyu/simple-pig-latin/readme.md

+42-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,48 @@ Move the first letter of each word to the end of it, then add "ay" to the end of
44

55
## Examples
66

7-
```js
7+
```javascript
88
pigIt('Pig latin is cool'); // igPay atinlay siay oolcay
99
pigIt('Hello world !'); // elloHay orldway !
1010
```
11+
12+
```objc
13+
pigIt(@"Pig latin is cool"); // => @"igPay atinlay siay oolcay"
14+
pigIt(@"Hello world !"); // => @"elloHay orldway !"
15+
```
16+
17+
```ruby
18+
pig_it('Pig latin is cool') # igPay atinlay siay oolcay
19+
pig_it('Hello world !') # elloHay orldway !
20+
```
21+
22+
```python
23+
pig_it('Pig latin is cool') # igPay atinlay siay oolcay
24+
pig_it('Hello world !') # elloHay orldway !
25+
```
26+
27+
```csharp
28+
Kata.PigIt("Pig latin is cool"); // igPay atinlay siay oolcay
29+
Kata.PigIt("Hello world !"); // elloHay orldway !
30+
```
31+
32+
```C++
33+
pig_it("Pig latin is cool"); // igPay atinlay siay oolcay
34+
pig_it("Hello world !"); // elloHay orldway
35+
```
36+
37+
```Java
38+
PigLatin.pigIt('Pig latin is cool'); // igPay atinlay siay oolcay
39+
PigLatin.pigIt('Hello world !'); // elloHay orldway !
40+
```
41+
42+
```clojure
43+
(piglatin/pig-it "Pig latin is cool") ; "igPay atinlay siay oolcay"
44+
(piglatin/pig-it "Hello world !") ; "elloHay orldway !"
45+
```
46+
47+
---
48+
49+
## Tags
50+
51+
- Algorithms

kata/5 kyu/valid-parentheses/readme.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ Write a function called that takes a string of parentheses, and determines if th
1313

1414
## Constraints
1515

16+
`0 <= input.length <= 100`
17+
18+
```if-not:javascript,go
19+
Along with opening (`(`) and closing (`)`) parenthesis, input may contain any valid ASCII characters. Furthermore, the input string may be empty and/or not contain any parentheses at all. Do **not** treat other forms of brackets as parentheses (e.g. `[]`, `{}`, `<>`).
1620
```
17-
0 <= input.length <= 100
18-
```
21+
22+
---
23+
24+
## Tags
25+
26+
- Algorithms
27+
- Logic
28+
- Utilities
29+
- Validation

kata/6 kyu/array-dot-diff/readme.md

+122-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,132 @@ Your goal in this kata is to implement a difference function, which subtracts on
44

55
It should remove all values from list `a`, which are present in list `b`.
66

7-
```py
7+
```javascript
8+
arrayDiff([1, 2], [1]) == [2];
9+
```
10+
11+
```ruby
12+
array_diff([1,2],[1]) == [2]
13+
```
14+
15+
```python
816
array_diff([1,2],[1]) == [2]
917
```
1018

19+
```coffeescript
20+
arrayDiff([1,2],[1]) == [2]
21+
```
22+
23+
```haskell
24+
difference [1,2] [1] == [2]
25+
```
26+
27+
```csharp
28+
Kata.ArrayDiff(new int[] {1, 2}, new int[] {1}) => new int[] {2}
29+
```
30+
31+
```fsharp
32+
arrayDiff [|1|] [|1; 2|] = [|2|]
33+
```
34+
35+
```rust
36+
array_diff(vec![1,2], vec![1]) == vec![2]
37+
```
38+
39+
```clojure
40+
(= (array-diff [1 2] [1]) [2])
41+
```
42+
43+
```groovy
44+
Kata.arrayDiff([1,2],[1]) == [2]
45+
```
46+
47+
```julia
48+
arraydiff([1,2],[1]) == [2]
49+
```
50+
51+
```nim
52+
arrayDiff(@[1,2],@[1]) == @[2]
53+
```
54+
55+
```php
56+
arrayDiff([1,2],[1]) == [2]
57+
```
58+
59+
```r
60+
array_diff(c(1, 2), 1) == 2
61+
```
62+
63+
```prolog
64+
array_diff([1, 2], [1], [2]). % Result = [2]
65+
```
66+
1167
If a value is present in `b`, all of its occurrences must be removed from the other:
1268

13-
```py
69+
```javascript
70+
arrayDiff([1, 2, 2, 2, 3], [2]) == [1, 3];
71+
```
72+
73+
```ruby
74+
array_diff([1,2],[1]) == [2]
75+
```
76+
77+
```python
1478
array_diff([1,2,2,2,3],[2]) == [1,3]
1579
```
80+
81+
```coffeescript
82+
arrayDiff([1,2,2,2,3],[2]) == [1,3]
83+
```
84+
85+
```haskell
86+
difference [1,2,2,2,3] [2] == [1,3]
87+
```
88+
89+
```csharp
90+
Kata.ArrayDiff(new int[] {1, 2, 2, 2, 3}, new int[] {2}) => new int[] {1, 3}
91+
```
92+
93+
```fsharp
94+
arrayDiff [|2|] [|1; 2; 2; 2; 3|] = [|1; 3|]
95+
```
96+
97+
```rust
98+
array_diff(vec![1,2,2,2,3], vec![2]) == vec![1,3]
99+
```
100+
101+
```clojure
102+
(= (array-diff [1,2,2,2,3] [2]) [1,3])
103+
```
104+
105+
```groovy
106+
Kata.arrayDiff([1,2,2,2,3],[2]) == [1,3]
107+
```
108+
109+
```julia
110+
arraydiff([1,2,2,2,3],[2]) == [1,3]
111+
```
112+
113+
```nim
114+
arrayDiff(@[1,2,2,2,3],@[2]) == @[1,3]
115+
```
116+
117+
```php
118+
arrayDiff([1,2,2,2,3],[2]) == [1,3]
119+
```
120+
121+
```r
122+
array_diff(c(1, 2, 2, 2, 3), 2) == c(1, 3)
123+
```
124+
125+
```prolog
126+
array_diff([1, 2, 2, 2, 3], [2], [1, 3]). % Result = [1, 3]
127+
```
128+
129+
---
130+
131+
## Tags
132+
133+
- Arrays
134+
- Data Types
135+
- Fundamentals

kata/6 kyu/bit-counting/readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You can guarantee that input is non-negative.
44

55
_Example_: The binary representation of `1234` is `10011010010`, so the function should return `5` in this case
6+
7+
---
8+
9+
## Tags
10+
11+
- Algorithms
12+
- Binary
13+
- Bits
+17-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# [Build a pile of Cubes](https://www.codewars.com/kata/5592e3bd57b64d00f3000047)
22

3-
Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of n^3, the cube above will have volume of (n-1)^3 and so on until the top which will have a volume of 1^3.
3+
Your task is to construct a building which will be a pile of n cubes.
4+
The cube at the bottom will have a volume of n^3, the cube above
5+
will have volume of (n-1)^3 and so on until the top which will have a volume of 1^3.
46

5-
You are given the total volume m of the building. Being given m can you find the number n of cubes you will have to build?
7+
You are given the total volume m of the building.
8+
Being given m can you find the number n of cubes you will have to build?
69

7-
The parameter of the function findNb `(find_nb, find-nb, findNb)` will be an integer m and you have to return the integer n such as n^3 + (n-1)^3 + ... + 1^3 = m if such a n exists or -1 if there is no such n.
10+
The parameter of the function findNb `(find_nb, find-nb, findNb)` will be an integer m
11+
and you have to return the integer n such as
12+
n^3 + (n-1)^3 + ... + 1^3 = m
13+
if such a n exists or -1 if there is no such n.
814

915
## Examples:
1016

@@ -13,10 +19,17 @@ findNb(1071225) --> 45
1319
findNb(91716553919377) --> -1
1420
```
1521

16-
```py
22+
```nasm
1723
mov rdi, 1071225
1824
call find_nb ; rax <-- 45
1925
2026
mov rdi, 91716553919377
2127
call find_nb ; rax <-- -1
2228
```
29+
30+
---
31+
32+
## Tags
33+
34+
- Fundamentals
35+
- Optimization
+10-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# [Consecutive strings](https://www.codewars.com/kata/56a5d994ac971f1ac500003e)
22

3-
You are given an array `strarr` of strings and an integer `k`. Your task is to return the **first** longest string consisting of k **consecutive** strings taken in the array.
3+
You are given an array `strarr` of strings and an integer `k`. Your task is to return the **first** longest string
4+
consisting of k **consecutive** strings taken in the array.
45

5-
## Example:
6+
# Example:
67

78
longest_consec(["zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"], 2) --> "abigailtheta"
89

910
n being the length of the string array, if `n = 0` or `k > n` or `k <= 0` return "".
1011

11-
## Note
12+
# Note
1213

1314
consecutive strings : follow one after another without an interruption
15+
16+
---
17+
18+
## Tags
19+
20+
- Fundamentals

0 commit comments

Comments
 (0)