Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
* [Test Max Profit Three](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/buy_sell_stock/test_max_profit_three.py)
* [Test Max Profit Two](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/buy_sell_stock/test_max_profit_two.py)
* [Test Max Profit With Fee](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/buy_sell_stock/test_max_profit_with_fee.py)
* Cherry Pickup
* [Test Cherry Pickup](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/cherry_pickup/test_cherry_pickup.py)
* Climb Stairs
* [Test Climb Stairs](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/climb_stairs/test_climb_stairs.py)
* Coin Change
Expand Down Expand Up @@ -109,6 +111,8 @@
* [Test Min Distance](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/min_distance/test_min_distance.py)
* Min Path Sum
* [Test Min Path Sum](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/min_path_sum/test_min_path_sum.py)
* Number Of People Aware Of A Secret
* [Test Number Of People Aware Of A Secret](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/number_of_people_aware_of_a_secret/test_number_of_people_aware_of_a_secret.py)
* Painthouse
* [Test Min Cost To Paint Houses](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/dynamic_programming/painthouse/test_min_cost_to_paint_houses.py)
* Palindromic Substring
Expand Down Expand Up @@ -161,6 +165,8 @@
* [Test Nearest Exit From Entrance](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/graphs/nearest_exit_from_entrance_in_maze/test_nearest_exit_from_entrance.py)
* Network Delay Time
* [Test Network Delay Time](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/graphs/network_delay_time/test_network_delay_time.py)
* Number Of Connected Components
* [Test Number Of Connected Components](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/graphs/number_of_connected_components/test_number_of_connected_components.py)
* Number Of Islands
* [Test Number Of Distinct Islands](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/graphs/number_of_islands/test_number_of_distinct_islands.py)
* [Test Number Of Islands](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/graphs/number_of_islands/test_number_of_islands.py)
Expand Down Expand Up @@ -213,14 +219,22 @@
* Two City Scheduling
* [Test Two City Scheduling](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/greedy/two_city_scheduling/test_two_city_scheduling.py)
* Hash Table
* Custom Sort String
* [Test Custom Sort String](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/custom_sort_string/test_custom_sort_string.py)
* Duplicate File In System
* [Test Find Duplicate Files In System](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/duplicate_file_in_system/test_find_duplicate_files_in_system.py)
* First Unique Character
* [Test First Unique Character](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/first_unique_character/test_first_unique_character.py)
* Jewels And Stones
* [Test Jewels And Stones](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/jewels_and_stones/test_jewels_and_stones.py)
* Maxlen Contiguous Binary Subarray
* [Test Maxlen Contiguous Binary Subarray](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/maxlen_contiguous_binary_subarray/test_maxlen_contiguous_binary_subarray.py)
* Powerful Integers
* [Test Powerful Integers](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/powerful_integers/test_powerful_integers.py)
* Ransom Note
* [Test Ransom Note](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/ransom_note/test_ransom_note.py)
* Word Pattern
* [Test Word Pattern](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/hash_table/word_pattern/test_word_pattern.py)
* Heap
* Construct Target With Sums
* [Test Construct Target With Sums](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/heap/construct_target_with_sums/test_construct_target_with_sums.py)
Expand Down Expand Up @@ -294,8 +308,12 @@
* Matrix
* Best Meeting Point
* [Test Best Meeting Point](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/best_meeting_point/test_best_meeting_point.py)
* Game Of Life
* [Test Game Of Life](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/game_of_life/test_game_of_life.py)
* Isvalidsudoku
* [Test Is Valid Sudoku](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/isvalidsudoku/test_is_valid_sudoku.py)
* Rotting Oranges
* [Test Rotting Oranges](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/rotting_oranges/test_rotting_oranges.py)
* Transpose
* [Test Transpose](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/transpose/test_transpose.py)
* [Test Transpose Matrix](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/matrix/transpose/test_transpose_matrix.py)
Expand Down Expand Up @@ -364,6 +382,8 @@
* Search Suggestions
* [Test Search Suggestions](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/search/trie/search_suggestions/test_search_suggestions.py)
* Sliding Window
* Frequency Of The Most Frequent Element
* [Test Frequency Of Most Frequent Element](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sliding_window/frequency_of_the_most_frequent_element/test_frequency_of_most_frequent_element.py)
* Length Of Longest Substring
* [Test Length Of Longest Substring](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sliding_window/length_of_longest_substring/test_length_of_longest_substring.py)
* [Test Longest Substring Without Repeating Characters](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sliding_window/length_of_longest_substring/test_longest_substring_without_repeating_characters.py)
Expand All @@ -383,6 +403,9 @@
* [Test Repeated Dna Sequences](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sliding_window/repeated_dna_sequences/test_repeated_dna_sequences.py)
* Substring Concatenation
* [Test Substring With Concatenation Of Words](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sliding_window/substring_concatenation/test_substring_with_concatenation_of_words.py)
* Sort And Search
* Russian Doll Envelopes
* [Test Russian Doll Envelopes](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sort_and_search/russian_doll_envelopes/test_russian_doll_envelopes.py)
* Sorting
* Heapsort
* [Test Heap Sort](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/sorting/heapsort/test_heap_sort.py)
Expand Down Expand Up @@ -432,6 +455,8 @@
* [Test Index Pairs Of A String](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/trie/index_pairs_of_a_string/test_index_pairs_of_a_string.py)
* Longest Word With Prefixes
* [Test Longest Word With Prefixes](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/trie/longest_word_with_prefixes/test_longest_word_with_prefixes.py)
* Replace Words
* [Test Replace Words](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/trie/replace_words/test_replace_words.py)
* Topkfreqwords
* [Test Top K Frequent Words](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/trie/topkfreqwords/test_top_k_frequent_words.py)
* Two Pointers
Expand All @@ -445,6 +470,10 @@
* [Test Count Pairs](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/count_pairs/test_count_pairs.py)
* Find Sum Of Three
* [Test Find Sum Of Three](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/find_sum_of_three/test_find_sum_of_three.py)
* Issubsequence
* [Test Is Subsequence](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/issubsequence/test_is_subsequence.py)
* Max Score
* [Test Max Score](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/max_score/test_max_score.py)
* Merge Sorted Arrays
* [Test Merge Sorted Arrays](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/merge_sorted_arrays/test_merge_sorted_arrays.py)
* Move Zeroes
Expand Down Expand Up @@ -486,6 +515,9 @@
* [Test Two Sum](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/two_sum_less_k/test_two_sum.py)
* Valid Word Abbreviation
* [Test Valid Word Abbreviation](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/two_pointers/valid_word_abbreviation/test_valid_word_abbreviation.py)
* Union Find
* Acounts Merge
* [Test Accounts Merge](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/union_find/acounts_merge/test_accounts_merge.py)
* Unique Bsts
* [Unique Bsts](https://github.com/BrianLusina/PythonSnips/blob/master/algorithms/unique_bsts/unique_bsts.py)
* Word Count
Expand All @@ -502,6 +534,8 @@
* [Test Number Of One Bits](https://github.com/BrianLusina/PythonSnips/blob/master/bit_manipulation/number_of_1_bits/test_number_of_one_bits.py)
* Single Number
* [Test Single Number](https://github.com/BrianLusina/PythonSnips/blob/master/bit_manipulation/single_number/test_single_number.py)
* Sum Of Subset Xor
* [Test Sum Of All Subset Xor Totals](https://github.com/BrianLusina/PythonSnips/blob/master/bit_manipulation/sum_of_subset_xor/test_sum_of_all_subset_xor_totals.py)
* Sum Two Integers
* [Test Sum Of Two Integers](https://github.com/BrianLusina/PythonSnips/blob/master/bit_manipulation/sum_two_integers/test_sum_of_two_integers.py)

Expand Down Expand Up @@ -636,6 +670,8 @@
* [With Ordered Dict](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/lrucache/with_ordered_dict.py)
* Map Sum
* [Test Map Sum Pairs](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/map_sum/test_map_sum_pairs.py)
* Nested Iterator
* [Test Nested Iterator](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/nested_iterator/test_nested_iterator.py)
* Orderedstream
* [Test Ordered Stream](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/orderedstream/test_ordered_stream.py)
* Queues
Expand All @@ -658,6 +694,8 @@
* [Test Smallest Infinite Set](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/smallest_infinite_set/test_smallest_infinite_set.py)
* Snapshot Array
* [Test Snapshot Array](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/snapshot_array/test_snapshot_array.py)
* Sparse Vector
* [Test Sparse Vector](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/sparse_vector/test_sparse_vector.py)
* Stacks
* Maxstack
* [Test Max Stack](https://github.com/BrianLusina/PythonSnips/blob/master/datastructures/stacks/maxstack/test_max_stack.py)
Expand Down Expand Up @@ -923,8 +961,6 @@
* [Test Max Number Of Ksum Pairs](https://github.com/BrianLusina/PythonSnips/blob/master/puzzles/arrays/max_number_of_ksum_pairs/test_max_number_of_ksum_pairs.py)
* Maximum Average Subarray
* [Test Max Average Subarray](https://github.com/BrianLusina/PythonSnips/blob/master/puzzles/arrays/maximum_average_subarray/test_max_average_subarray.py)
* Maxlen Contiguous Binary Subarray
* [Test Maxlen Contiguous Binary Subarray](https://github.com/BrianLusina/PythonSnips/blob/master/puzzles/arrays/maxlen_contiguous_binary_subarray/test_maxlen_contiguous_binary_subarray.py)
* Rotation
* Cyclic Rotation
* [Test Cyclic Rotation](https://github.com/BrianLusina/PythonSnips/blob/master/puzzles/arrays/rotation/cyclic_rotation/test_cyclic_rotation.py)
Expand Down Expand Up @@ -1001,6 +1037,8 @@
* [Wraps](https://github.com/BrianLusina/PythonSnips/blob/master/pyfuncs/decorators/wraps.py)

## Pymath
* Adding Two Negabinary Numbers
* [Test Add Two Negabinary Numbers](https://github.com/BrianLusina/PythonSnips/blob/master/pymath/adding_two_negabinary_numbers/test_add_two_negabinary_numbers.py)
* Divisible By 7 Not 5
* [Test Divisible By7 Not 5](https://github.com/BrianLusina/PythonSnips/blob/master/pymath/divisible_by_7_not_5/test_divisible_by7_not_5.py)
* Even Digits
Expand Down Expand Up @@ -1072,8 +1110,6 @@
* [Test Is Prefix Of Word](https://github.com/BrianLusina/PythonSnips/blob/master/pystrings/is_prefix/test_is_prefix_of_word.py)
* Is Unique
* [Test Is Unique](https://github.com/BrianLusina/PythonSnips/blob/master/pystrings/is_unique/test_is_unique.py)
* Issubsequence
* [Test Is Subsequence](https://github.com/BrianLusina/PythonSnips/blob/master/pystrings/issubsequence/test_is_subsequence.py)
* Lexicographically Largest String
* [Test Lexicographically Largest String](https://github.com/BrianLusina/PythonSnips/blob/master/pystrings/lexicographically_largest_string/test_lexicographically_largest_string.py)
* Longest Common Prefix
Expand Down Expand Up @@ -1259,7 +1295,6 @@
* [Test Queen Attack](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_queen_attack.py)
* [Test Queue To Do](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_queue_to_do.py)
* [Test Rectangle](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_rectangle.py)
* [Test Replace Words](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_replace_words.py)
* [Test Robot Name](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_robot_name.py)
* [Test Scale Generator](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_scale_generator.py)
* [Test Scrabble](https://github.com/BrianLusina/PythonSnips/blob/master/tests/puzzles/test_scrabble.py)
Expand Down Expand Up @@ -1461,6 +1496,7 @@
* [Json Files](https://github.com/BrianLusina/PythonSnips/blob/master/utils/json_files.py)
* Network
* [Urllib Module](https://github.com/BrianLusina/PythonSnips/blob/master/utils/network/urllib_module.py)
* [Test Utils](https://github.com/BrianLusina/PythonSnips/blob/master/utils/test_utils.py)
* [User File](https://github.com/BrianLusina/PythonSnips/blob/master/utils/user_file.py)
* Video Optimizer
* [Video](https://github.com/BrianLusina/PythonSnips/blob/master/utils/video_optimizer/video.py)
Expand Down
41 changes: 41 additions & 0 deletions pymath/adding_two_negabinary_numbers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Adding Two Negabinary Numbers

Given two numbers arr1 and arr2 in base -2, return the result of adding them together.

Each number is given in array format: as an array of 0s and 1s, from most significant bit to least significant bit.
For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3. A number arr in array, format is also
guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
Comment on lines +5 to +7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the input-format sentence to avoid ambiguity.

Line 5 through Line 7 have grammar/punctuation issues ("format: as an array" and "array, format") that make the input contract harder to parse.

Suggested patch
-Each number is given in array format:  as an array of 0s and 1s, from most significant bit to least significant bit. 
-For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3.  A number arr in array, format is also
-guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
+Each number is given in array format as an array of 0s and 1s, from the most significant bit to the least significant bit.
+For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3.
+An array-format number is guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Each number is given in array format: as an array of 0s and 1s, from most significant bit to least significant bit.
For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3. A number arr in array, format is also
guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
Each number is given in array format as an array of 0s and 1s, from the most significant bit to the least significant bit.
For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3.
An array-format number is guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
🧰 Tools
🪛 LanguageTool

[grammar] ~5-~5: A determiner may be missing.
Context: ...0s and 1s, from most significant bit to least significant bit. For example, arr = [1...

(THE_SUPERLATIVE)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pymath/adding_two_negabinary_numbers/README.md` around lines 5 - 7, The
README.md file in the pymath/adding_two_negabinary_numbers directory has grammar
and punctuation issues in lines 5-7 that create ambiguity in the input format
description. Fix the redundant and awkwardly-phrased "format:  as an array"
construct on line 5 by removing the colon and extra space, and correct the
confusing "array, format" phrase on line 7 by removing the comma. The sentences
should flow more naturally while clearly describing that the input numbers are
provided as arrays of 0s and 1s from most significant to least significant bit.

Source: Linters/SAST tools


Return the result of adding arr1 and arr2 in the same format: as an array of 0s and 1s with no leading zeros.

## Examples

Example 1:
```text
Input: arr1 = [1,1,1,1,1], arr2 = [1,0,1]
Output: [1,0,0,0,0]
Explanation: arr1 represents 11, arr2 represents 5, the output represents 16.
```

Example 2:
```text
Input: arr1 = [0], arr2 = [0]
Output: [0]
```

Example 3:
```text
Input: arr1 = [0], arr2 = [1]
Output: [1]
```

## Constraints

- 1 <= arr1.length, arr2.length <= 1000
- arr1[i] and arr2[i] are 0 or 1
- arr1 and arr2 have no leading zeros

## Topics

- Array
- Math
81 changes: 81 additions & 0 deletions pymath/adding_two_negabinary_numbers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
from typing import List


def add_negabinary(arr1: List[int], arr2: List[int]) -> List[int]:
# Initialize pointers to the least significant bits(rightmost elements)
index_1, index_2 = len(arr1) - 1, len(arr2) - 1

# Initialize carry value for addition
carry = 0

# Result to store the sum digits
result = []

# Process digits from right to left, including any remaining carry
while index_1 >= 0 or index_2 >= 0 or carry != 0:
# Get current digit from arr1, or 0 if we've exhausted arr1
digit_1 = 0 if index_1 < 0 else arr1[index_1]

# Get current digit from arr2, or 0 if we've exhausted arr2
digit_2 = 0 if index_2 < 0 else arr2[index_2]

# Calculate sum of current position including carry
current_sum = digit_1 + digit_2 + carry

# Reset carry for next iteration
carry = 0

# Handle negabinary addition rules
if current_sum >= 2:
# If sum is 2 or more, subtract 2 and set negative carry
current_sum -= 2
carry = -1
elif current_sum == -1:
# If sum is -1, set digit to 1 and positive carry
current_sum = 1
carry = 1

# Append the computed digit to result
result.append(current_sum)

# Move pointest to the next more significant bits
index_1 -= 1
index_2 -= 1

# Remove leading zeros from the result (except if result is just [0]
while len(result) > 1 and result[-1] == 0:
result.pop()

# Reverse the result since we built it from least to most significant
return result[::-1]


def add_negabinary_2(arr1: List[int], arr2: List[int]) -> List[int]:
arr1 = arr1[::-1]
arr2 = arr2[::-1]

max_len = max(len(arr1), len(arr2))

result = []
carry = 0

i = 0
while i < max_len or carry != 0:
bit1 = arr1[i] if i < len(arr1) else 0
bit2 = arr2[i] if i < len(arr2) else 0

total = bit1 + bit2 + carry

if total >= 0:
result.append(total % 2)
carry = -(total // 2)
else:
result.append(1)
carry = 1

i += 1

while len(result) > 1 and result[-1] == 0:
result.pop()

return result[::-1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import unittest
from typing import List
from parameterized import parameterized
from utils.test_utils import custom_test_name_func
from pymath.adding_two_negabinary_numbers import add_negabinary, add_negabinary_2

ADD_TWO_NEGABINARY_NUMBERS_TEST_CASES = [
([0], [0], [0]),
([0], [1], [1]),
([1], [1], [1, 1, 0]),
([1, 0], [1], [1, 1]),
([1, 1, 1, 1, 1], [1, 0, 1], [1, 0, 0, 0, 0]),
([1, 0, 0], [0], [1, 0, 0]),
([1, 1, 0], [1, 0, 1], [1, 1, 0, 1, 1]),
([1, 1], [1], [0]),
]


class AddTwoNegabinaryNumbersTestCase(unittest.TestCase):
@parameterized.expand(
ADD_TWO_NEGABINARY_NUMBERS_TEST_CASES, name_func=custom_test_name_func
)
def test_add_two_negabinary_numbers(
self, arr1: List[int], arr2: List[int], expected: List[int]
):
actual = add_negabinary(arr1, arr2)
self.assertEqual(expected, actual)

@parameterized.expand(
ADD_TWO_NEGABINARY_NUMBERS_TEST_CASES, name_func=custom_test_name_func
)
def test_add_two_negabinary_numbers_2(
self, arr1: List[int], arr2: List[int], expected: List[int]
):
actual = add_negabinary_2(arr1, arr2)
self.assertEqual(expected, actual)


if __name__ == "__main__":
unittest.main()
Loading