When given a problem set, I always try working it out first, then I go on Google and look up multiple solutions. However, I don't copy it. I just break down the code to see the codes and ideas behind their solution. Then I type my own code from scratch. I'm not sure if what I am doing is considered cheating.
The Academic Honesty rules set out at the top of each Problem Set documents includes the following as one of the Unreasonable actions:
Searching for or soliciting outright solutions to problem sets online or elsewhere.
Going to Google and looking up solutions is therefore not allowed under the honor code.