Skip to content

Instantly share code, notes, and snippets.

@RahmatSaeedi
Created May 10, 2021 14:33
Show Gist options
  • Save RahmatSaeedi/5d3967142404193813f8bd09b036a983 to your computer and use it in GitHub Desktop.
Save RahmatSaeedi/5d3967142404193813f8bd09b036a983 to your computer and use it in GitHub Desktop.
CodeSignal - Arcade - Intro - JS - depositProfit
function depositProfit(deposit, rate, threshold) {
return Math.ceil(Math.log(parseFloat(threshold)/parseFloat(deposit)) / Math.log(1 + parseFloat(rate)/100.0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment