The Complexity of Solving Low Degree Equations over Ring of Integers and Residue Rings