"Shape Area" - Codesignal #5 - PYTHON Solution

Опубликовано: 17 Июнь 2026
на канале: Joshua
1,315
22

Like and Subscribe if you enjoy my content!
Or give advice or alternative solutions in the comments below!
Problem: https://app.codesignal.com/arcade/int...

Below we will define an n-interesting polygon. Your task is to find the area of a polygon for a given n.

A 1-interesting polygon is just a square with a side of length 1. An n-interesting polygon is obtained by taking the n - 1-interesting polygon and appending 1-interesting polygons to its rim, side by side. You can see the 1-, 2-, 3- and 4-interesting polygons in the picture below.

More CodeSignal:    • CodeSignal  

More LeetCode:    • Leetcode  

More HackerRank:    • HackerRank  

*******************************************************************************************

Follow me on:
Twitter -   / joshuacadavez  
LinkedIn -   / joshuacadavez  
GitHub - https://github.com/JoshuaTheEngineer