ronantakizawa/codereview-bench huggingface dataset:
Repository: TheAlgorithms/C-Plus-Plus
File: greedy_algorithms/binary_addition.cpp (C++)

Code before:
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("101", "11") == "1000");
    assert(binaryAddition.addBinary("0", "0") == "0");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("0", "10101") == "10101");
    assert(binaryAddition.addBinary("10101", "0") == "10101");
    assert(binaryAddition.addBinary("101010101010101010101010101010",
                                    "110110110110110110110110110110") ==
           "1100001100001100001100001100000");
    assert(binaryAddition.addBinary("1", "11111111") == "100000000");
    assert(binaryAddition.addBinary("10101010", "01010101") == "11111111");

    // Invalid binary string tests (should return empty string)
    assert(binaryAddition.addBinary("10102", "1101") == "");
    assert(binaryAddition.addBinary("ABC", "1101") == "");
    assert(binaryAddition.addBinary("1010", "1102") == "");
    assert(binaryAddition.addBinary("111", "1x1") == "");
    assert(binaryAddition.addBinary("1x1", "111") == "");
    assert(binaryAddition.addBinary("1234", "1101") == "");
}

/**
 * Main function to execute the program.
 */
int main() {
    tests();
    std::cout << "All tests passed.\n";
    return 0;
}


Review comment (suggestion):
```suggestion
    tests(); // run self test implementation
```

Code after:
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("101", "11") == "1000");
    assert(binaryAddition.addBinary("0", "0") == "0");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("0", "10101") == "10101");
    assert(binaryAddition.addBinary("10101", "0") == "10101");
    assert(binaryAddition.addBinary("101010101010101010101010101010",
                                    "110110110110110110110110110110") ==
           "1100001100001100001100001100000");
    assert(binaryAddition.addBinary("1", "11111111") == "100000000");
    assert(binaryAddition.addBinary("10101010", "01010101") == "11111111");

    // Invalid binary string tests (should return empty string)
    assert(binaryAddition.addBinary("10102", "1101") == "");
    assert(binaryAddition.addBinary("ABC", "1101") == "");
    assert(binaryAddition.addBinary("1010", "1102") == "");
    assert(binaryAddition.addBinary("111", "1x1") == "");
    assert(binaryAddition.addBinary("1x1", "111") == "");
    assert(binaryAddition.addBinary("1234", "1101") == "");
}

/**
 * @brief main function
 * @returns 0 on successful exit
 */
int main() {
    tests(); /// To execute tests
    return 0;
}
Repository: TheAlgorithms/C-Plus-Plus
File: greedy_algorithms/binary_addition.cpp (C++)

Code before:
    // Valid binary string tests
    assert(binaryAddition.addBinary("1010", "1101") == "10111");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("101", "11") == "1000");
    assert(binaryAddition.addBinary("0", "0") == "0");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("0", "10101") == "10101");
    assert(binaryAddition.addBinary("10101", "0") == "10101");
    assert(binaryAddition.addBinary("101010101010101010101010101010",
                                    "110110110110110110110110110110") ==
           "1100001100001100001100001100000");
    assert(binaryAddition.addBinary("1", "11111111") == "100000000");
    assert(binaryAddition.addBinary("10101010", "01010101") == "11111111");

    // Invalid binary string tests (should return empty string)
    assert(binaryAddition.addBinary("10102", "1101") == "");
    assert(binaryAddition.addBinary("ABC", "1101") == "");
    assert(binaryAddition.addBinary("1010", "1102") == "");
    assert(binaryAddition.addBinary("111", "1x1") == "");
    assert(binaryAddition.addBinary("1x1", "111") == "");
    assert(binaryAddition.addBinary("1234", "1101") == "");
}

/**
 * @brief main function
 */
int main() {
    tests(); /// To execute tests
    return 0;
}


Review comment (suggestion):
```suggestion
 * @brief main function
 * @returns 0 on successful exit
```

Code after:

    // Valid binary string tests
    assert(binaryAddition.addBinary("1010", "1101") == "10111");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("101", "11") == "1000");
    assert(binaryAddition.addBinary("0", "0") == "0");
    assert(binaryAddition.addBinary("1111", "1111") == "11110");
    assert(binaryAddition.addBinary("0", "10101") == "10101");
    assert(binaryAddition.addBinary("10101", "0") == "10101");
    assert(binaryAddition.addBinary("101010101010101010101010101010",
                                    "110110110110110110110110110110") ==
           "1100001100001100001100001100000");
    assert(binaryAddition.addBinary("1", "11111111") == "100000000");
    assert(binaryAddition.addBinary("10101010", "01010101") == "11111111");

    // Invalid binary string tests (should return empty string)
    assert(binaryAddition.addBinary("10102", "1101") == "");
    assert(binaryAddition.addBinary("ABC", "1101") == "");
    assert(binaryAddition.addBinary("1010", "1102") == "");
    assert(binaryAddition.addBinary("111", "1x1") == "");
    assert(binaryAddition.addBinary("1x1", "111") == "");
    assert(binaryAddition.addBinary("1234", "1101") == "");
}

/**
 * @brief main function
 * @returns 0 on successful exit
 */
int main() {
    tests(); /// To execute tests
    return 0;
}
Repository: TheAlgorithms/C-Plus-Plus
File: graph/topological_sort.cpp (C++)

Code before:
    }
    std::cout << '\n';
    assert(ans_2 == expected_2);
    std::cout << "Test Passed\n\n";

    // Test 3 - Graph with cycle
    std::cout << "Testing for graph 3\n";
    int n_3 = 3;
    graph::Graph graph3(n_3);
    graph3.addEdge(0, 1);
    graph3.addEdge(1, 2);
    graph3.addEdge(2, 0);
    try {
        graph::topologicalSort(graph3);
    } catch (std::invalid_argument& err) {
        assert(std::string(err.what()) == "cycle detected in graph");
    }
    std::cout << "Test Passed\n";
}

/**
 * @brief Main function
 * @returns 0 on exit
 */
int main() {
    test();
    return 0;
}


Review comment (suggestion):
```suggestion
    test(); // run self test implementations
```

Code after:
    graph2.addEdge(2, 4);
    std::vector<int> ans_2 = graph::topological_sort::topologicalSort(graph2);
    std::vector<int> expected_2 = {0, 1, 2, 4, 3};
    std::cout << "Topological Sorting Order: ";
    for (int i : ans_2) {
        std::cout << i << " ";
    }
    std::cout << '\n';
    assert(ans_2 == expected_2);
    std::cout << "Test Passed\n\n";

    // Test 3 - Graph with cycle
    std::cout << "Testing for graph 3\n";
    int n_3 = 3;
    graph::topological_sort::Graph graph3(n_3);
    graph3.addEdge(0, 1);
    graph3.addEdge(1, 2);
    graph3.addEdge(2, 0);
    try {
        graph::topological_sort::topologicalSort(graph3);
    } catch (std::invalid_argument& err) {
        assert(std::string(err.what()) == "cycle detected in graph");
    }
    std::cout << "Test Passed\n";
}

/**
 * @brief Main function
 * @returns 0 on exit
 */
int main() {
    test();  // run self test implementations
    return 0;
}
Repository: TheAlgorithms/C-Plus-Plus
File: bit_manipulation/check_even_odd.cpp (C++)

Code before:
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>
#include <iostream>  /// for IO operations
#include <string>

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        std::string checkEvenOdd(std::int64_t N) {
            return (N & 1) == 0 ? "Even" : "Odd";
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::checkEvenOdd;

    // Test Even numbers
    assert(checkEvenOdd(0) == "Even");
    assert(checkEvenOdd(2) == "Even");
    assert(checkEvenOdd(100) == "Even");
    assert(checkEvenOdd(-4) == "Even");
    assert(checkEvenOdd(-1000) == "Even");

    // Test Odd numbers
    assert(checkEvenOdd(1) == "Odd");
    assert(checkEvenOdd(3) == "Odd");
    assert(checkEvenOdd(101) == "Odd");
    assert(checkEvenOdd(-5) == "Odd");

Review comment (suggestion):
```suggestion
        bool checkEvenOdd(std::int64_t N) {
```

Code after:
 *     Number: 10 (decimal) -> 00001010 (binary)
 *       LSB = 0 -> Even number
 * 
 *     Number: 13 (decimal) -> 00001101 (binary)
 *       LSB = 1 -> Odd number
 *
 * In both cases, evaluating (N & 1) isolates the LSB:
 * - For 10: 00001010 & 00000001 = 0  (Even)
 * - For 13: 00001101 & 00000001 = 1  (Odd)
 *
 * Worst Case Time Complexity: O(1)
 * Space Complexity: O(1)
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>   /// for uint32_t
#include <iostream>  /// for IO operations
#include <string>    /// for std::string

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        bool is_even(std::int64_t N) {
            return (N & 1) == 0 ? true : false;
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::is_even;
Repository: TheAlgorithms/C-Plus-Plus
File: bit_manipulation/check_even_odd.cpp (C++)

Code before:
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>
#include <iostream>  /// for IO operations
#include <string>

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        std::string checkEvenOdd(std::int64_t N) {
            return (N & 1) == 0 ? "Even" : "Odd";
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::checkEvenOdd;

    // Test Even numbers
    assert(checkEvenOdd(0) == "Even");
    assert(checkEvenOdd(2) == "Even");
    assert(checkEvenOdd(100) == "Even");
    assert(checkEvenOdd(-4) == "Even");
    assert(checkEvenOdd(-1000) == "Even");

    // Test Odd numbers
    assert(checkEvenOdd(1) == "Odd");
    assert(checkEvenOdd(3) == "Odd");
    assert(checkEvenOdd(101) == "Odd");
    assert(checkEvenOdd(-5) == "Odd");
    assert(checkEvenOdd(-999) == "Odd");

Review comment (suggestion):
```suggestion
            return (N & 1) == 0;
```

Code after:
 *       LSB = 0 -> Even number
 * 
 *     Number: 13 (decimal) -> 00001101 (binary)
 *       LSB = 1 -> Odd number
 *
 * In both cases, evaluating (N & 1) isolates the LSB:
 * - For 10: 00001010 & 00000001 = 0  (Even)
 * - For 13: 00001101 & 00000001 = 1  (Odd)
 *
 * Worst Case Time Complexity: O(1)
 * Space Complexity: O(1)
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>   /// for uint32_t
#include <iostream>  /// for IO operations
#include <string>    /// for std::string

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        bool is_even(std::int64_t N) {
            return (N & 1) == 0 ? true : false;
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::is_even;

    // Test Even numbers
Repository: TheAlgorithms/C-Plus-Plus
File: bit_manipulation/check_even_odd.cpp (C++)

Code before:
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>
#include <iostream>  /// for IO operations
#include <string>

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        std::string checkEvenOdd(std::int64_t N) {
            return (N & 1) == 0 ? "Even" : "Odd";
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::checkEvenOdd;

    // Test Even numbers
    assert(checkEvenOdd(0) == "Even");
    assert(checkEvenOdd(2) == "Even");
    assert(checkEvenOdd(100) == "Even");
    assert(checkEvenOdd(-4) == "Even");
    assert(checkEvenOdd(-1000) == "Even");

    // Test Odd numbers
    assert(checkEvenOdd(1) == "Odd");
    assert(checkEvenOdd(3) == "Odd");
    assert(checkEvenOdd(101) == "Odd");
    assert(checkEvenOdd(-5) == "Odd");

Review comment (suggestion):
```suggestion
        std::string is_even(std::int64_t N) {
```

Code after:
 *     Number: 10 (decimal) -> 00001010 (binary)
 *       LSB = 0 -> Even number
 * 
 *     Number: 13 (decimal) -> 00001101 (binary)
 *       LSB = 1 -> Odd number
 *
 * In both cases, evaluating (N & 1) isolates the LSB:
 * - For 10: 00001010 & 00000001 = 0  (Even)
 * - For 13: 00001101 & 00000001 = 1  (Odd)
 *
 * Worst Case Time Complexity: O(1)
 * Space Complexity: O(1)
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>   /// for uint32_t
#include <iostream>  /// for IO operations
#include <string>    /// for std::string

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        bool is_even(std::int64_t N) {
            return (N & 1) == 0 ? true : false;
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::is_even;
Repository: TheAlgorithms/C-Plus-Plus
File: bit_manipulation/check_even_odd.cpp (C++)

Code before:
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>   /// for uint32_t
#include <iostream>  /// for IO operations
#include <string>    /// for std::string

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        std::string is_even(std::int64_t N) {
            return (N & 1) == 0 ? "Even" : "Odd";
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::is_even;

    // Test Even numbers
    assert(is_even(0) == "Even");
    assert(is_even(2) == "Even");
    assert(is_even(100) == "Even");
    assert(is_even(-4) == "Even");
    assert(is_even(-1000) == "Even");

    // Test Odd numbers
    assert(is_even(1) == "Odd");
    assert(is_even(3) == "Odd");
    assert(is_even(101) == "Odd");
    assert(is_even(-5) == "Odd");

Review comment (suggestion):
```suggestion
        bool is_even(std::int64_t N) {
```

Code after:
 *
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <cassert>   /// for assert
#include <cstdint>   /// for uint32_t
#include <iostream>  /// for IO operations
#include <string>    /// for std::string

/**
 * @namespace bit_manipulation
 * @brief Bit manipulation algorithms
 */
namespace bit_manipulation {
/**
 * @namespace even_odd
 * @brief Functions for checking if a number is even or odd using bitwise operations
 */
namespace even_odd {

/**
 * @brief Checks if a number is even or odd using bitwise AND.
 * @param N The number to check.
 * @returns "Even" if N is even, "Odd" if N is odd.
     */
        bool is_even(std::int64_t N) {
            return (N & 1) == 0 ? true : false;
        }

    }  // namespace even_odd
}  // namespace bit_manipulation

/**
 * @brief Self-test implementations
 * @returns void
 */
static void test() {
    using bit_manipulation::even_odd::is_even;

    // Test Even numbers
    assert(is_even(0) == true);
    assert(is_even(2) == true);
    assert(is_even(100) == true);
    assert(is_even(-4) == true);
    assert(is_even(-1000) == true);

    // Test Odd numbers
    assert(is_even(1) == false);
    assert(is_even(3) == false);
    assert(is_even(101) == false);
    assert(is_even(-5) == false);
Repository: TheAlgorithms/C-Plus-Plus
File: math/factorial_memoization.cpp (C++)

Code before:

/// Array to store computed factorials for memoization
std::array<uint64_t, 1000> memo{0};

/**
 * @brief Computes the factorial of a non-negative integer using recursion and memoization.
 * @param n The integer whose factorial is to be computed
 * @returns The factorial of n
 */
uint64_t fact_recursion(uint64_t n) {
    if (n == 0) return 1;        // Base case: 0! = 1
    if (memo[n] != 0) return memo[n]; // Return already computed value
    memo[n] = n * fact_recursion(n - 1);    // Store and return the computed value
    return memo[n];
}

/**
 * @brief Self-test implementations for the fact_recursion function.
 * @returns void
 */
void test_fact_recursion() {
    // Test cases for factorial computation
    assert(fact_recursion(0) == 1);
    assert(fact_recursion(1) == 1);
    assert(fact_recursion(5) == 120);
    assert(fact_recursion(10) == 3628800);
    std::cout << "All test cases passed!\n";
}

/**
 * @brief Main function to run test cases and interact with the user.
 * @returns 0 on program success
 */
int main() {
    // Run test cases
    test_fact_recursion();
    return 0;
}


Review comment (suggestion):
```suggestion
    assert(math::fact_recursion(0) == 1);
    assert(math::fact_recursion(1) == 1);
    assert(math::fact_recursion(5) == 120);
    assert(math::fact_recursion(10) == 3628800);
```

Code after:
#include <array>    // For std::array
#include <cstdint>  // For uint64_t

/// Array to store computed factorials for memoization
std::array<uint64_t, 1000> memo{0};

/**
 * @namespace math
 * @brief Math algorithms
 */
namespace math {

/**
 * @brief Computes the factorial of a non-negative integer using recursion and memoization.
 * @param n The integer whose factorial is to be computed
 * @returns The factorial of n
 */
uint64_t fact_recursion(uint64_t n) {
    if (n == 0) return 1;        // Base case: 0! = 1
    if (memo[n] != 0) return memo[n]; // Return already computed value
    memo[n] = n * fact_recursion(n - 1);    // Store and return the computed value
    return memo[n];
}

} // namespace math
/**
 * @brief Self-test implementations for the fact_recursion function.
 * @returns void
 */
void test_fact_recursion() {
    // Test cases for factorial computation
    assert(math::fact_recursion(0) == 1);
    assert(math::fact_recursion(1) == 1);
    assert(math::fact_recursion(5) == 120);
    assert(math::fact_recursion(10) == 3628800);
    std::cout << "All test cases passed!\n";
}

/**
 * @brief Main function to run test cases and interact with the user.
 * @returns 0 on program success
 */
int main() {
    // Run test cases
    test_fact_recursion();
    return 0;
}
Repository: TheAlgorithms/C-Plus-Plus
File: math/factorial_memoization.cpp (C++)

Code before:
/**
 * @file
 * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Factorial)
 * @details
 * This program computes the factorial of a non-negative integer using recursion
 * with memoization (top-down dynamic programming). It stores intermediate results
 * to avoid redundant calculations for improved efficiency.
 * 
 * Example:
 * Input: n = 5
 * Output: 120
 * 
 * Explanation: 5! = 5 × 4 × 3 × 2 × 1 = 120
 * 
 * The program uses a recursive function fact_recursion which caches computed 
 * results in a memo array to avoid recalculating factorials for the same numbers.
 *
 * Time Complexity: O(n)
 * Space Complexity: O(n)
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <iostream> // for std::cout
#include <cassert>  // For test cases
#include <array>    // For std::array
#include <cstdint>  // For uint64_t

/// Array to store computed factorials for memoization

Review comment (suggestion):
```suggestion
 * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization](https://en.wikipedia.org/wiki/Memoization) 
```

Code after:
/**
 * @file
 * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization](https://en.wikipedia.org/wiki/Memoization) 
 * @details
 * This program computes the factorial of a non-negative integer using recursion
 * with memoization (top-down dynamic programming). It stores intermediate results
 * to avoid redundant calculations for improved efficiency.
 * 
 * Memoization is a form of caching where the result to an expensive function call
 * is stored and returned.
 * Example:
 * Input: n = 5
 * Output: 120
 * 
 * Explanation: 5! = 5 × 4 × 3 × 2 × 1 = 120
 * 
 * The program uses a recursive function fact_recursion which caches computed 
 * results in a memo array to avoid recalculating factorials for the same numbers.
 *
 * Time Complexity: O(n)
 * Space Complexity: O(n)
 * @author [Vedant Mukhedkar](https://github.com/git5v)
 */

#include <iostream> // for std::cout
#include <cassert>  // For test cases
#include <array>    // For std::array
#include <cstdint>  // For uint64_t