<human>: Here's the situation.

In my computer systems class we were assigned some standard homework problems. 

One of the problems was write a function which returns the number of set bits in a binary string.

I already knew that this count was called the "Hamming weight", so I googled it and went to the wikipedia page.

I followed one of the implementation on the wikipedia page and coded a function to complete the problems. 

I hand it in and am greeted with quite a surprise.

I'm the only person who answered that question correctly.

My professor then goes on to say that question is essentially there to catch "cheaters" because theres no way a student in that level class would know the solution. She gives me two options, either admit I cheated in front of the class and face no consequences or she'll take it to the dean where I could face automatic failure or perhaps even worse.

I figured the most logical decision was to just get the matter over with and admit to cheating, even though I felt I was perfectly in the right. It's not worth risking my scholarship/financial aid over a single homework assignment.

While I could understand the accusation of cheating if this were a test, it was a simple homework assignment. The purpose of homework is to learn. In fact, she even allowed student collboration and help from the TAs. How is that any different than using google?

I'm just really bummed because I feel this is just an ego trip on my teachers part but theres nothing I can really do about it.

Summarize the given text in a few sentences.
<bot>: Got accused of cheating for consulting wikipedia for homework help. I had to admit that I knowingly cheated infront of whole class.