@reagentx/

Rectangle into Squares

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
def sqInRect(lng, wdth):
    if lng == wdth:
        return None
    out_l = []
    while lng > 0 and wdth > 0:
        small_side = min(lng, wdth)
        large_side = max(lng, wdth)
        out_l.append(small_side)
        lng, wdth = small_side, large_side - small_side
    return out_l
    
print(sqInRect(5, 3))