Quick question about Comp Sci scoring

<p>Let me answer this slightly differently than @some11no.</p>

<p>The principle rule we use in scoring is: if it works, it’s eligible for full credit. The only reason a solution might not be eligible for full credit is if the problem description explicitly tells you to do it one way, or explicitly forbids you from doing it another way. </p>

<p>There isn’t necessarily a “best answer” for each problem. The published exams have “canonical solutions”, which are ideal in terms of elegance, length, and function. We publish those so that students and teachers can see examples of good solutions. But an inelegant solution that works is just fine.</p>

<p>So … your one-line solution above would be fine (depending on how you interpret the “note”). But typically, the exam writers develop questions that don’t have such simple solutions, so that there’s a chance for you to show your algorithm development skills.</p>