You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You mention more than one algorithm. You can create a separate issue for each algorithm once the current one is completed.
You propose an algorithm that is already present or has been mentioned in a previous issue.
You create a new issue without completing your previous issue.
Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.
Name: Frog Jump
[NEW ALGORITHM]
About:
Propose a new algorithm to be added to the repository
Geek wants to climb from the 0th stair to the (n-1)th stair. At a time the Geek can climb either one or two steps. A height[N] array is also given. Whenever the geek jumps from stair i to stair j, the energy consumed in the jump is abs(height[i]- height[j]), where abs() means the absolute difference. return the minimum energy that can be used by the Geek to jump from stair 0 to stair N-1.
Example:
Input: n = 4, height = {10 20 30 10}
Output: 20
Explanation:
Geek jump from 1st to 2nd stair(|20-10| = 10 energy lost). Then a jump from the 2nd to the last stair(|10-20| = 10 energy lost). So, total energy lost is 20 which is the minimum.
Expected Time Complexity: O(n)
Expected Space Complexity: O(n)
Labels:
new algorithm, gssoc-ext, hacktoberfest, level1
Assignees:
Contributor in GSSoC-ext
Want to work on it
The text was updated successfully, but these errors were encountered:
Issue will be closed if:
Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.
Name: Frog Jump
[NEW ALGORITHM]
About:
Propose a new algorithm to be added to the repository
Geek wants to climb from the 0th stair to the (n-1)th stair. At a time the Geek can climb either one or two steps. A height[N] array is also given. Whenever the geek jumps from stair i to stair j, the energy consumed in the jump is abs(height[i]- height[j]), where abs() means the absolute difference. return the minimum energy that can be used by the Geek to jump from stair 0 to stair N-1.
Example:
Input: n = 4, height = {10 20 30 10}
Output: 20
Explanation:
Geek jump from 1st to 2nd stair(|20-10| = 10 energy lost). Then a jump from the 2nd to the last stair(|10-20| = 10 energy lost). So, total energy lost is 20 which is the minimum.
Expected Time Complexity: O(n)
Expected Space Complexity: O(n)
Labels:
new algorithm, gssoc-ext, hacktoberfest, level1
Assignees:
The text was updated successfully, but these errors were encountered: