You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 years ago | |
|---|---|---|
| .. | ||
| src | 3 years ago | |
| Cargo.toml | 3 years ago | |
| README.md | 3 years ago | |
README.md
The algorithm iterates over the nums vector exactly once. For each element in the nums vector, it performs a constant amount of work - it updates cur_farthest and checks if i is equal to cur_end. If i is equal to cur_end, it increments jumps and updates cur_end. All of these operations take constant time.
Therefore, the time complexity of the algorithm is O(n), where n is the length of the nums vector.