You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,41 +12,45 @@ Each task should come with a solution plus some tests to verify.
12
12
Create a function `maskify` to mask digits of a credit card number with `#`.
13
13
14
14
**Requirements:**
15
-
* Do not mask the first digit and the last four digits
16
-
* Do not mask non-digit chars
17
-
* Do not mask if the input is less than 6
18
-
* Return '' when input is empty
15
+
16
+
- Do not mask the first digit and the last four digits
17
+
- Do not mask non-digit chars
18
+
- Do not mask if the input is less than 6
19
+
- Return '' when input is empty
19
20
20
21
### Task 2
21
22
22
23
Create a function `number_to_ordinal` to create an ordinal number for a given input.
23
24
Ordinal numbers in English have something like `st`, `nd`, `rd`, etc.
24
25
25
26
**Requirements:**
26
-
* Apply for number 1 to 1001... if that works any given number will do ;-)
27
+
28
+
- Apply for number 1 to 1001... if that works any given number will do ;-)
27
29
28
30
### Task 3
29
31
30
32
Create a calculator for [Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation).
31
33
Write a `calculate` function that accepts an input and returns the result of the operation.
32
34
33
35
**Requirements:**
34
-
* Support the mathematical operations for `+`, `-`, `*` and `/`
35
-
* Check for invalid syntax, like `2 3+`. There is a space missing.
36
-
* Return 0 (integer) when nothing is entered
37
-
* Return the numeric value when no operand is given, like `1 2 3.5` return `3.5`
36
+
37
+
- Support the mathematical operations for `+`, `-`, `*` and `/`
38
+
- Check for invalid syntax, like `2 3+`. There is a space missing.
39
+
- Return 0 (integer) when nothing is entered
40
+
- Return the numeric value when no operand is given, like `1 2 3.5` return `3.5`
38
41
39
42
### Task 4
40
43
41
44
Given you have an array of numbers, you move inside the array by the value of the current element.
42
45
Write a function `jump_out_of_array` that outputs
43
46
44
-
* the amount of jumps until you jump out of the array
45
-
*`-1` when you reach the end of the array but do not jump out
47
+
- the amount of jumps until you jump out of the array
48
+
-`-1` when you reach the end of the array but do not jump out
46
49
47
-
**Requirements:**
48
-
* Array size is indefinite
49
-
* Array elements are integers, positive and negative
50
+
** Requirements:**
51
+
52
+
- Array size is indefinite
53
+
- Array elements are integers, positive and negative
50
54
51
55
**Example:**
52
56
@@ -71,11 +75,8 @@ of pairs.
71
75
_Do not_ use nested loops to solve this problem, because of a time complexity of the loop solution.
72
76
[Check this thread](https://stackoverflow.com/questions/11032015/how-to-find-time-complexity-of-an-algorithm) to see what time complexity of an algorithm means.
73
77
74
-
75
78
**Example:**
76
79
77
-
Given a number `6` and an array `A[1, 8, -3, 0, 1, 3, -2, 4, 5]` the amount of pairs is `7`.
78
-
79
80
*`A[0]` + `A[8]` = `1` + `5` = `6`
80
81
*`A[1]` + `A[6]` = `8` + `-2` = `6`
81
82
*`A[4]` + `A[8]` = `1` + `5` = `6`
@@ -86,5 +87,5 @@ Given a number `6` and an array `A[1, 8, -3, 0, 1, 3, -2, 4, 5]` the amount of p
86
87
87
88
## Contribute
88
89
89
-
Feel free to contribute. Use the issue list to propose new tasks or open PRs. Just provide proper tests
90
+
Feel free to contribute. Use the issue list to propose new tasks or open PRs. Just provide proper tests
0 commit comments