We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
For anyone struggling, use this as a reference for how to calculate the area. The overall method should otherwise look the same as the perimeter problem. Note however that the points are ordered counter-clockwise and not clockwise and therefore you'll need to adapt the area formula from the link provided accordinging (negative when moving forward and positive when moving back instead of the other way around).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Area of a Polygon
You are viewing a single comment's thread. Return to all comments →
For anyone struggling, use this as a reference for how to calculate the area. The overall method should otherwise look the same as the perimeter problem. Note however that the points are ordered counter-clockwise and not clockwise and therefore you'll need to adapt the area formula from the link provided accordinging (negative when moving forward and positive when moving back instead of the other way around).