Skip to content

Instantly share code, notes, and snippets.

@Vijaysinh
Forked from nick3499/shapeArea.js
Last active December 3, 2020 08:58
Show Gist options
  • Save Vijaysinh/cd8e8b5ceeba95b03699edf396c31f16 to your computer and use it in GitHub Desktop.
Save Vijaysinh/cd8e8b5ceeba95b03699edf396c31f16 to your computer and use it in GitHub Desktop.
CodeFights: shapeArea(n) Challenge
// https://nick3499.medium.com/codefights-shape-area-challenge-3319d3e6dc62
function shapeArea(n) {
init = 1;
return init + (n * ((n - 1) * 2));
}
console.log(shapeArea(4));
@Vijaysinh
Copy link
Author

1_FRGycEafYPHdUfntOGyG8Q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment