Skip to content

Instantly share code, notes, and snippets.

@proustibat
Last active March 3, 2021 06:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save proustibat/dc4e49a341b019b6fd70ca0f223a6996 to your computer and use it in GitHub Desktop.
Save proustibat/dc4e49a341b019b6fd70ca0f223a6996 to your computer and use it in GitHub Desktop.
We will define an n-interesting polygon. Your task is to find the area of a polygon for a given n.
const shapeArea = n => Math.pow( n, 2 ) + Math.pow( n - 1, 2 );
@proustibat
Copy link
Author

area

@moizirshad
Copy link

return (n*n)+((n-1)*(n-1))

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