Skip to content

Commit d683285

Browse files
committed
Added a link to explain idea's origin.
1 parent e108d6e commit d683285

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

data_structures/stacks/kth_next_greater_element.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""
2-
Author : Yuan Jack Yao
3-
Date : May 27, 2026
4-
52
Implement the function to find the kth Next Greatest Element (NGE), if it exists, for all elements.
3+
Idea comes from my blog: https://starsexpress.github.io/SkyHorse/docs/stack/2454_hard/second_next_greater
64
"""
75

86
from __future__ import annotations
@@ -18,7 +16,6 @@ def find_kth_next_greater_element(
1816
) -> list[int | float | None]:
1917
"""
2018
Efficient general method to seek the kth NGE for all elements.
21-
2219
Approach is entirely based on k stacks, which are actually very easy to understand.
2320
These k stacks symbolize how many NGEs an element has already found.
2421

0 commit comments

Comments
 (0)