Friday, March 29, 2024

📑 Histograms with Colors by Values

Histograms with Colors by Values




Thursday, January 4, 2024

📑ASCII Art

ASCII Art


Saturday, November 25, 2023

📑 Fun Random Selection of Students in the Class

Fun Random Selection of Students in the Class

Which pupil should go to the board?

Saturday, May 27, 2023

📑 AGG filtering

Anti-Grain Geometry (AGG) & Matplotlib Artists





Sunday, May 21, 2023

📑 Farewell Round A 2023 Task 5 Untie

Farewell Round A 2023. Task 5

Python Only

T=int(input())
for t in range(T):
    C=input()
    if len(set(C))==1:
        count=len(C)//2+len(C)%2
    else:
        while C[0]==C[-1]:
            C=C[1:]+C[0]
        count=C.count('PP')+C.count('SS')+C.count('RR')
    print('Case #{}: {}'.format((t+1),count))