diff --git a/challenges/ascii-art/README.md b/challenges/ascii-art/README.md index a075ee1..02ff16f 100644 --- a/challenges/ascii-art/README.md +++ b/challenges/ascii-art/README.md @@ -43,13 +43,13 @@ The characters that are not in the intervals `[a-z]` or `[A-Z]` will be shown as ### Constraints -- 0 < W < 30 -- 0 < H < 30 -- 0 < N < 200 +- $$0 < W < 30$$ +- $$0 < H < 30$$ +- $$0 < N < 200$$ ## Source -- [CodinGame](https://www.codingame.com/training/easy/ascii-art) +[CodinGame](https://www.codingame.com/training/easy/ascii-art) ## Examples diff --git a/challenges/caesar-cipher/README.md b/challenges/caesar-cipher/README.md index e11498d..952fdf0 100644 --- a/challenges/caesar-cipher/README.md +++ b/challenges/caesar-cipher/README.md @@ -27,7 +27,7 @@ Create a function that will return the sentence after shifting the alphabet. ## Source -- [Wikipedia - Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) +[Wikipedia - Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) ## Examples diff --git a/challenges/cakes-swerc-2020-2021/README.md b/challenges/cakes-swerc-2020-2021/README.md index 1a1dc5f..69df1da 100644 --- a/challenges/cakes-swerc-2020-2021/README.md +++ b/challenges/cakes-swerc-2020-2021/README.md @@ -32,7 +32,7 @@ available ingredients. ## Source -- [SWERC 2020–2021 - Problem E: Cake](https://swerc.eu/2020/problems/) +[SWERC 2020–2021 - Problem E: Cake](https://swerc.eu/2020/problems/) ## Examples diff --git a/challenges/defibrillators/README.md b/challenges/defibrillators/README.md index fc8144c..3890e8e 100644 --- a/challenges/defibrillators/README.md +++ b/challenges/defibrillators/README.md @@ -48,11 +48,11 @@ The name of the defibrillator located the closest to the user’s position. ### Constraints -- 0 < `N` < 10 000 +- $$0 < N < 10 000$$ ## Source -- [CodinGame](https://www.codingame.com/training/easy/defibrillators) +[CodinGame](https://www.codingame.com/training/easy/defibrillators) ## Examples diff --git a/challenges/heap-algorithm/README.md b/challenges/heap-algorithm/README.md index d42c990..08207bf 100644 --- a/challenges/heap-algorithm/README.md +++ b/challenges/heap-algorithm/README.md @@ -10,7 +10,7 @@ The order of the generated permutations is important, see the example below. ## Source -- [Heap's Algorithm - Wikipedia](https://en.wikipedia.org/wiki/Heap%27s_algorithm) +[Heap's Algorithm - Wikipedia](https://en.wikipedia.org/wiki/Heap%27s_algorithm) ## Examples diff --git a/challenges/look-and-say-sequence-conway/README.md b/challenges/look-and-say-sequence-conway/README.md index 70aca8e..3368b7d 100644 --- a/challenges/look-and-say-sequence-conway/README.md +++ b/challenges/look-and-say-sequence-conway/README.md @@ -20,7 +20,7 @@ Write a program that prints the next term of the **look-and-say sequence**. ## Source -- [Look-and-say sequence - Wikipedia](https://en.wikipedia.org/wiki/Look-and-say_sequence) +[Look-and-say sequence - Wikipedia](https://en.wikipedia.org/wiki/Look-and-say_sequence) ## Examples diff --git a/challenges/offset-arrays/README.md b/challenges/offset-arrays/README.md index 1484ef5..57b1b4c 100644 --- a/challenges/offset-arrays/README.md +++ b/challenges/offset-arrays/README.md @@ -24,15 +24,15 @@ You are given a list of `n` array definitions and your job is to figure out what ### Constraints -- 1 <= `n` <= 100 -- Array names consist only of uppercase letters A to Z -- Array lengths are between 1 and 100 (no empty arrays) -- Indexing operations have at most 50 levels of nesting -- Indices are always within bounds in the test cases +- $$1 <= n <= 100$$ +- Array names consist only of uppercase letters A to Z. +- Array lengths are between 1 and 100 (no empty arrays). +- Indexing operations have at most 50 levels of nesting. +- Indices are always within bounds in the test cases. ## Source -- [CodinGame](https://www.codingame.com/ide/puzzle/offset-arrays) +[CodinGame](https://www.codingame.com/ide/puzzle/offset-arrays) ## Examples diff --git a/challenges/prefix-suffix/README.md b/challenges/prefix-suffix/README.md index 7b90efe..0d39616 100644 --- a/challenges/prefix-suffix/README.md +++ b/challenges/prefix-suffix/README.md @@ -20,7 +20,7 @@ Write a programs that takes 2 strings ("words") and prints if one is a prefix/su - **Line 1:** `true` if the second word is a **prefix** of the first, `false` otherwise - **Line 1:** `true` if the second word is a **suffix** of the first, `false` otherwise -## Source +## Sources - [Wikipedia - Prefix](https://en.wikipedia.org/wiki/Prefix) - [Wikipedia - Suffix](https://en.wikipedia.org/wiki/Suffix) diff --git a/challenges/reverse-polish-notation/README.md b/challenges/reverse-polish-notation/README.md index ac58333..5699789 100644 --- a/challenges/reverse-polish-notation/README.md +++ b/challenges/reverse-polish-notation/README.md @@ -20,7 +20,7 @@ All the numbers are integers; you don't need to worry about floating point numbe ## Source -- [Reverse polish notation - Codewars](https://www.codewars.com/kata/52f78966747862fc9a0009ae) +[Reverse polish notation - Codewars](https://www.codewars.com/kata/52f78966747862fc9a0009ae) ## Examples diff --git a/challenges/roman-numerals/README.md b/challenges/roman-numerals/README.md index 71e4d5d..53132f5 100644 --- a/challenges/roman-numerals/README.md +++ b/challenges/roman-numerals/README.md @@ -35,7 +35,7 @@ Here are the rules for building a Roman numeral: - **Line 1:** The string : `arabic to roman` or `roman to arabic` to determine how to convert the number - **Line 2:** The number to convert -## Source +## Sources - [Wikipedia - Roman numerals](https://en.wikipedia.org/wiki/Roman_numerals) - [Wikipedia - Arabic numerals](https://en.wikipedia.org/wiki/Arabic_numerals) diff --git a/challenges/single-number/README.md b/challenges/single-number/README.md new file mode 100644 index 0000000..756c3de --- /dev/null +++ b/challenges/single-number/README.md @@ -0,0 +1,41 @@ +# single-number + +Created by [@theoludwig](https://github.com/theoludwig) on 21 August 2023. + +## Instructions + +Given a **non-empty** array of integers, every element appears twice except for one. Find that single one. + +You must implement a solution with a linear runtime complexity and use only constant extra space. + +### Constraints + +- $$1 <= numbers.length <= 3 * 10^4$$ +- $$-3 * 10^4 <= numbers[index] <= 3 * 10^4$$ +- Each element in the array appears twice except for one element which appears only once. + +## Source + +[LeetCode - Single Number](https://leetcode.com/problems/single-number/) + +## Examples + +See the `test` folder for examples of input/output. + +### Example 1 + +#### Input + +```txt +4 +1 +2 +1 +2 +``` + +#### Output + +```txt +4 +``` diff --git a/challenges/single-number/solutions/.gitkeep b/challenges/single-number/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/single-number/test/1/input.txt b/challenges/single-number/test/1/input.txt new file mode 100644 index 0000000..e710b72 --- /dev/null +++ b/challenges/single-number/test/1/input.txt @@ -0,0 +1,5 @@ +4 +1 +2 +1 +2 \ No newline at end of file diff --git a/challenges/single-number/test/1/output.txt b/challenges/single-number/test/1/output.txt new file mode 100644 index 0000000..bf0d87a --- /dev/null +++ b/challenges/single-number/test/1/output.txt @@ -0,0 +1 @@ +4 \ No newline at end of file diff --git a/challenges/single-number/test/2/input.txt b/challenges/single-number/test/2/input.txt new file mode 100644 index 0000000..9359a2b --- /dev/null +++ b/challenges/single-number/test/2/input.txt @@ -0,0 +1,3 @@ +2 +2 +1 \ No newline at end of file diff --git a/challenges/single-number/test/2/output.txt b/challenges/single-number/test/2/output.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/challenges/single-number/test/2/output.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/challenges/single-number/test/3/input.txt b/challenges/single-number/test/3/input.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/challenges/single-number/test/3/input.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/challenges/single-number/test/3/output.txt b/challenges/single-number/test/3/output.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/challenges/single-number/test/3/output.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/challenges/sorting-algorithms/README.md b/challenges/sorting-algorithms/README.md index d7c2fea..472cecf 100644 --- a/challenges/sorting-algorithms/README.md +++ b/challenges/sorting-algorithms/README.md @@ -20,7 +20,7 @@ Write a function that takes a list of integers and sort them in ascending order. ## Source -- [Wikipedia - Sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm) +[Wikipedia - Sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm) ## Examples diff --git a/challenges/sudoku/README.md b/challenges/sudoku/README.md index 0f795a3..3ea112a 100644 --- a/challenges/sudoku/README.md +++ b/challenges/sudoku/README.md @@ -20,7 +20,7 @@ The empty cells are represented by 0. ## Source -- [Wikipedia - Sudoku](https://en.wikipedia.org/wiki/Sudoku) +[Wikipedia - Sudoku](https://en.wikipedia.org/wiki/Sudoku) ## Examples