Width Min Max Algorithm Python Example