Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added test case for tuple
  • Loading branch information
neha3423 committed Oct 23, 2023
commit 49fdc869f400674da8dcb021ca31db0ae6d92e94
4 changes: 4 additions & 0 deletions data_structures/arrays/kth_largest_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def kth_largest_element(arr: list[int], position: int) -> int:
Traceback (most recent call last):
...
ValueError: The position should be an integer
>>> kth_largest_element((4,6,1,2),4)
Traceback (most recent call last):
...
TypeError: 'tuple' object does not support item assignment
"""
if not arr:
return -1
Expand Down