Since there are only 35 students and the total of students in both is 17+22=39, 39-35=4 joined both if all students joined at least one, so 4 would be the minimum.
If 35-22=13 students joined neither group, then of the remaining students 17 would be in both groups and 5 would be in the debate team.
If all the students that joined the guitar class also joined the debate team, then the maximum for the debate team and guitar class is 17.