add dp solution