added medium level algorithm question