We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Pythonic and readable solution. This is not an optimized solution, but meant more for understanding a basic intuition.
This solution can be broken into the steps:
# algorithm
# first, find out current position (start)
# second, find the center (start + k, or approximate)
# third, find how far our range extends (center + k, or approximate), and remove anything up to that point in the array
# test = [1, 4, 5, 9, 11], k = 2, solution = [1, 5, 11]
Hackerland Radio Transmitters
You are viewing a single comment's thread. Return to all comments →
Pythonic and readable solution. This is not an optimized solution, but meant more for understanding a basic intuition.
This solution can be broken into the steps: