본문 바로가기
알고리즘/Codewars

[Codewars] Sum of angles (7 kyu) / JavaScript

by fluss 2023. 4. 5.

https://www.codewars.com/kata/5a03b3f6a1c9040084001765

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

Find the total sum of internal angles (in degrees) in an n-sided simple polygon. N will be greater than 2.

 

코드

function angle(n) {
  return (n - 2) * 180;
}

댓글