Skip to content

Commit

Permalink
added a top k most frequent elements test from the js version
Browse files Browse the repository at this point in the history
  • Loading branch information
CheezItMan committed Aug 24, 2021
1 parent fc88c1a commit 056e297
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_top_k_frequent_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ def test_it_works_with_example_2():
# Assert
assert numbers == [1]

def test_will_return_empty_list_given_an_empty_list():
# Arrange
numbers = []
k = 1

# Act
answer = top_k_frequent_elements(numbers, k)

# Assert
assert answer == []


def test_will_work_for_list_with_k_elements_all_unique():
# Arrange
numbers = [1, 2, 3]
Expand Down

0 comments on commit 056e297

Please sign in to comment.