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
100 dicks randomly spread out of 100 stairs, there can be as many dicks as you want on one step. We gotta go down these stairs.
Every time you step on a stair-step with dicks, the brat ratio increases by the number of dicks.
You can go down one or two steps at a time. Write a function to descend the stairs minimizing the brat ratio.
The function receives an array with the number of dicks on each step and returns the minimum brat index.
© Powered by Evgen Zaytsev
Stairway to heaven
Task:
100 dicks randomly spread out of 100 stairs, there can be as many dicks as you want on one step. We gotta go down these stairs.
Every time you step on a stair-step with dicks, the brat ratio increases by the number of dicks.
You can go down one or two steps at a time. Write a function to descend the stairs minimizing the brat ratio.
The function receives an array with the number of dicks on each step and returns the minimum brat index.
JS solution:
Tests:
codesandbox:
https://codesandbox.io/s/angry-bose-jv7ct?file=/src/index.js:0-383
The text was updated successfully, but these errors were encountered: