Every programming assignment should list all sources that contributed to the solution. It may also include the instructor, a tutor that was consulted, a reference book, a web site, etc. You may consult other students who are not part of your group as long as your question is small in scope and that you list the name of the student consulted at the top of your program. Sharing on that larger scale often amounts to one person copying the mistakes of another or getting a free ride on the efforts of another. A good rule of thumb is not to look at more than 1 screen of another person's code.
Intellectual honesty is important.
If homework solutions show work that is largely copied, it is program plagiarism and is not acceptable. Such work will typically be given a grade of 0. Repeated or serious offenses will be referred to the Associate Academic Dean for appropriate action. Students will be assigned to small groups for the purpose of doing a number of the in-class exercises, labs, and homework assignments. A few homework assignments will be given that must be done separately by each individual.