Last active
March 3, 2021 06:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shapeArea = n => Math.pow( n, 2 ) + Math.pow( n - 1, 2 ); |
Author
proustibat
commented
Dec 11, 2017
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