Dual-responsive polymer brushes as an electrochemical logic gate