Count of nested polygons that can be drawn by joining vertices internally | Function that counts the nested polygons inside another polygons ; Stores the count ; Child polygons can only exists if parent polygon has sides > 5 ; Get next nested polygon ; Return the count ; Given side of polygon ; Function call
def countNestedPolygons ( sides ) : NEW_LINE INDENT count = 0 NEW_LINE while ( sides > 5 ) : NEW_LINE INDENT sides //= 2 NEW_LINE count += 1 NEW_LINE DEDENT return count NEW_LINE DEDENT N = 12 NEW_LINE print ( countNestedPolygons ( N ) ) NEW_LINE