Skip to content

Commit 400e57f

Browse files
committed
[REFACTOR]: markdownlint fixes.
1 parent 2f9d79d commit 400e57f

File tree

6 files changed

+85
-44
lines changed

6 files changed

+85
-44
lines changed

CODE_OF_CONDUCT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
63+
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the
@@ -116,13 +116,13 @@ the community.
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124124
[homepage]: https://www.contributor-covenant.org
125125

126126
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
127+
<https://www.contributor-covenant.org/faq>. Translations are available at
128+
<https://www.contributor-covenant.org/translations>.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MIT License
1+
# MIT License
22

33
Copyright (c) 2023 Gonzalo Diaz
44

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Algorithm Exercises
22

3-
[![Node.js CI](https://github.com/sir-gon/algorithm-exercises-ts/actions/workflows/node.js.yml/badge.svg)](https://github.com/sir-gon/algorithm-exercises-ts/actions/workflows/node.js.yml) [![codecov](https://codecov.io/gh/sir-gon/algorithm-exercises-ts/branch/main/graph/badge.svg?token=7NBP9SQAY0)](https://codecov.io/gh/sir-gon/algorithm-exercises-ts)
3+
[![Node.js CI](https://github.com/sir-gon/algorithm-exercises-ts/actions/workflows/node.js.yml/badge.svg)](https://github.com/sir-gon/algorithm-exercises-ts/actions/workflows/node.js.yml)
4+
[![codecov](https://codecov.io/gh/sir-gon/algorithm-exercises-ts/branch/main/graph/badge.svg?token=7NBP9SQAY0)](https://codecov.io/gh/sir-gon/algorithm-exercises-ts)
45
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsir-gon%2Fprojecteuler-ts.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsir-gon%2Fprojecteuler-ts?ref=badge_shield)
56

6-
![GitHub](https://img.shields.io/github/license/sir-gon/algorithm-exercises-ts) ![GitHub language count](https://img.shields.io/github/languages/count/sir-gon/algorithm-exercises-ts) ![GitHub top language](https://img.shields.io/github/languages/top/sir-gon/algorithm-exercises-ts)
7+
![GitHub](https://img.shields.io/github/license/sir-gon/algorithm-exercises-ts)
8+
![GitHub language count](https://img.shields.io/github/languages/count/sir-gon/algorithm-exercises-ts)
9+
![GitHub top language](https://img.shields.io/github/languages/top/sir-gon/algorithm-exercises-ts)
710

811
## What is this?
912

10-
[Project Euler](https://projecteuler.net/) provide some algorithms and mathematical problems to solve to be used as experience tests.
13+
[Project Euler](https://projecteuler.net/) provide some algorithms and
14+
mathematical problems to solve to be used as experience tests.
1115

1216
Use this answers to learn some tip and tricks for algorithms tests.
1317

@@ -18,10 +22,24 @@ As Project Euler says:
1822
<https://projecteuler.net/about#publish>
1923

2024
```text
21-
I learned so much solving problem XXX, so is it okay to publish my solution elsewhere?
22-
It appears that you have answered your own question. There is nothing quite like that "Aha!" moment when you finally beat a problem which you have been working on for some time. It is often through the best of intentions in wishing to share our insights so that others can enjoy that moment too. Sadly, that will rarely be the case for your readers. Real learning is an active process and seeing how it is done is a long way from experiencing that epiphany of discovery. Please do not deny others what you have so richly valued yourself.
23-
24-
However, the rule about sharing solutions outside of Project Euler does not apply to the first one-hundred problems, as long as any discussion clearly aims to instruct methods, not just provide answers, and does not directly threaten to undermine the enjoyment of solving later problems. Problems 1 to 100 provide a wealth of helpful introductory teaching material and if you are able to respect our requirements, then we give permission for those problems and their solutions to be discussed elsewhere.
25+
I learned so much solving problem XXX, so is it okay
26+
to publish my solution elsewhere?
27+
28+
It appears that you have answered your own question. There is nothing quite
29+
like that "Aha!" moment when you finally beat a problem which you have been
30+
working on for some time. It is often through the best of intentions in wishing
31+
to share our insights so that others can enjoy that moment too. Sadly, that
32+
will rarely be the case for your readers. Real learning is an active process
33+
and seeing how it is done is a long way from experiencing that epiphany of
34+
discovery. Please do not deny others what you have so richly valued yourself.
35+
36+
However, the rule about sharing solutions outside of Project Euler does not
37+
apply to the first one-hundred problems, as long as any discussion clearly aims
38+
to instruct methods, not just provide answers, and does not directly threaten
39+
to undermine the enjoyment of solving later problems. Problems 1 to 100 provide
40+
a wealth of helpful introductory teaching material and if you are able to
41+
respect our requirements, then we give permission for those problems and their
42+
solutions to be discussed elsewhere.
2543
```
2644

2745
If you have better answers or optimal solutions, fork and PR-me
@@ -123,8 +141,10 @@ make docker/compose-run -e LOG_LEVEL=DEBUG -e BRUTEFORCE=true
123141
### Build and run a development image
124142

125143
Running container with development target.
126-
Designed to develop on top of this image. All source application is mounted as a volume in **/app** directory.
127-
Dependencies should be installed to run (not present in this target) so, you must install dependencies before run (or after a dependency add/change).
144+
Designed to develop on top of this image. All source application is mounted as
145+
a volume in **/app** directory.
146+
Dependencies should be installed to run (not present in this target) so, you
147+
must install dependencies before run (or after a dependency add/change).
128148

129149
```text
130150
# install node_modules dependencies using docker runtime and store them in host directory

src/hackerrank/implementation/betweenTwoSets.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@ array
1414
These numbers are referred to as being between the two arrays. Determine
1515
how many such numbers exist.
1616

17-
# Example
17+
## Example
18+
1819
$ a = [2, 6] $
1920

2021
$ b = [24, 36] $
2122

2223
There are two numbers between the arrays: $ 6 $ and $ 12 $.
23-
$ 6 \bmod 2 = 0 $, $ 6 \bmod 6 = 0 $, $ 24 \bmod 6 = 0 $ and $ 36 \bmod 6 = 0 $ for the first value.
24-
$ 12 \bmod 2 = 0 $, $ 12 \bmod 6 = 0 $, and $ 24 \bmod 12 = 0 $, $ 36 \bmod 12 = 0 $ for the second value. Return $ 2 $.
24+
$ 6 \bmod 2 = 0 $, $ 6 \bmod 6 = 0 $, $ 24 \bmod 6 = 0 $ and $ 36 \bmod 6 = 0 $
25+
for the first value.
26+
$ 12 \bmod 2 = 0 $, $ 12 \bmod 6 = 0 $, and $ 24 \bmod 12 = 0 $,
27+
$ 36 \bmod 12 = 0 $ for the second value. Return $ 2 $.
28+
29+
## Function Description
2530

26-
# Function Description
2731
Complete the getTotalX function in the editor below. It should return the
2832
number of integers that are betwen the sets.
2933

@@ -32,37 +36,44 @@ getTotalX has the following parameter(s):
3236
- int a[n]: an array of integers
3337
- int b[m]: an array of integers
3438

35-
# Returns
39+
## Returns
40+
3641
- int: the number of integers that are between the sets
3742

38-
# Input Format
43+
## Input Format
44+
3945
The first line contains two space-separated integers, n and m, the number
4046
of elements in arrays a and b.
4147
The second line contains n distinct space-separated integers $ a[i] $ where
4248
$ 0 \leq i < n $.
4349
The third line contains m distinct space-separated integers $ b[j] $ where
4450
$ 0 \leq j < m $.
4551

46-
# Constraints
52+
## Constraints
53+
4754
- $ 1 \leq n, m < 10 $
4855
- $ 1 \leq a[i] \leq 100 $
4956
- $ 1 \leq b[j] \leq 100 $
5057

51-
# Sample Input
52-
```
58+
## Sample Input
59+
60+
```text
5361
2 3
5462
2 4
5563
12 32 96
5664
```
5765

58-
# Sample Output
59-
```
66+
## Sample Output
67+
68+
```text
6069
3
6170
```
6271

63-
# Explanation
72+
## Explanation
73+
6474
2 and 4 divide evenly into 4, 8, 12 and 16.
6575

6676
4, 8 and 16 divide evenly into 16, 32, 96.
6777

68-
4, 8 and 16 are the only three numbers for which each element of a is a factor and each is a factor of all elements of b.
78+
4, 8 and 16 are the only three numbers for which each element of a is a factor
79+
and each is a factor of all elements of b.

src/hackerrank/implementation/birthday.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
- Difficulty: #easy
44
- Category: #implementation
55

6-
Two children, Lily and Ron, want to share a chocolate bar. Each of the squares has an integer on it.
6+
Two children, Lily and Ron, want to share a chocolate bar. Each of the squares
7+
has an integer on it.
78

89
Lily decides to share a contiguous segment of the bar selected such that:
910

src/hackerrank/implementation/bonAppetit.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Bill Division
1+
# [Bill Division](https://www.hackerrank.com/challenges/bon-appetit)
22

3-
https://www.hackerrank.com/challenges/bon-appetit
4-
5-
- Difficulty: [#easy](#easy)
6-
- Category: [#implementation](#implementation)
3+
Difficulty: #easy
4+
Category: #implementation
75

86
Two friends Anna and Brian, are deciding how to split the bill at a dinner.
97
Each will only pay for the items they consume. Brian gets the check and
@@ -15,66 +13,77 @@ the bill correctly, Anna will pay $ (2 / 4) / 2 = 3 $. If he includes the cost o
1513
$ bill[2] $, he will calculate $ (2 + 4 + 6) / 2 = 6 $. In the second case, he
1614
should refund $ 3 $ to Anna.
1715

18-
1916
## Function Description
17+
2018
Complete the bonAppetit function in the editor below. It should print
2119
**Bon Appetit** if the bill is fairly split. Otherwise, it should print
2220
the integer amount of money that Brian owes Anna.
2321
bonAppetit has the following parameter(s):
22+
2423
- bill: an array of integers representing the cost of each item ordered
2524
- k: an integer representing the zero-based index of the item Anna doesn't
2625
eat
2726
- b: the amount of money that Anna contributed to the bill
2827

2928
## Input Format
29+
3030
The first line contains two space-separated integers $ n $ and $ k $, the number
3131
of items ordered and the 0-based index of the item that Anna did not eat.
3232
The second line contains $ n $ space-separated integers bill[i] where 0 <= i < n.
3333
The third line contains an integer, b, the amount of money that Brian
3434
charged Anna for her share of the bill.
3535

3636
## Constraints
37-
* $ 2 \le n \le 10^5 $
38-
* $ 0 \leq k < n $
39-
* $ 0 \leq bill[i] < 10^4 $
40-
* $ 0 \leq b \leq \sum_{i=0}^{n-1} bill[i] $
41-
* The amount of money due Anna will always be an integer
37+
38+
- $ 2 \le n \le 10^5 $
39+
- $ 0 \leq k < n $
40+
- $ 0 \leq bill[i] < 10^4 $
41+
- $ 0 \leq b \leq \sum_{i=0}^{n-1} bill[i] $
42+
- The amount of money due Anna will always be an integer
4243

4344
## Output Format
45+
4446
If Brian did not overcharge Anna, print Bon Appetit on a new line;
4547
otherwise, print the difference (i.e., b_charged - b_actual) that Brian must
4648
refund to Anna. This will always be an integer.
4749

4850
## Sample Input 0
49-
```
51+
52+
```text
5053
4 1
5154
3 10 2 9
5255
12
5356
```
5457

5558
## Sample Output 0
56-
```
59+
60+
```text
5761
5
5862
```
5963

6064
## Explanation 0
65+
6166
Anna didn't eat item $ bill[i] = 10 $, but she shared the rest of the items with
6267
Brian. The total cost of the shared items is $ 3 + 2 + 9 + 14 $ and, split in
63-
half, the cost per person is $ b_{actual} = 7 $. Brian charged her $ b_{charged} = 12 $
68+
half, the cost per person is $ b_{actual} = 7 $. Brian charged her
69+
$ b_{charged} = 12 $
6470
for her portion of the bill. We print the amount Anna was overcharged,
6571
$ b_{charged} - b_{actual} = 12 - 7 = 5 $, on a new line.
6672

6773
## Sample Input 1
68-
```
74+
75+
```text
6976
4 1
7077
3 10 2 9
7178
7
7279
```
7380

7481
## Sample Output 1
75-
```
82+
83+
```text
7684
Bon Appetit
7785
```
86+
7887
Anna didn't eat item $ bill[1] = 10 $, but she shared the rest of the items with
7988
Brian. The total cost of the shared items is $ 3 + 2 + 9 = 14 $ and, split in
8089
half, the cost per person is b_actual = 7. Because b_actual = b_charged = 7,

0 commit comments

Comments
 (0)