{"id":"code-col-java-big-o-check-my-answers","audience":"college","category":"coding","track":"coding","technique":"format","title":"Check your Big-O answers with exact labels","free":false,"task":"You answered 4 Big-O questions from a past CS 2 exam and want them checked, not re-explained. Ask for exactly 4 numbered lines, one per snippet in order, each in the form 'A: Correct, O(n) - reason' or 'B: Wrong, O(n^2) - reason', where the Big-O is the right answer and the reason is under 12 words. Then one last line in the form 'Score: X/4'. No code blocks and under 90 words in total.","materialLabel":"The snippets and your answers (attached to your prompt automatically)","material":"CS 2 Practice Exam (Spring) - Question 6: give the Big-O of each snippet in terms of n.\n\nA)\nfor (int i = 0; i < n; i++) {\n    sum += arr[i];\n}\n\nB)\nfor (int i = 0; i < n; i++) {\n    for (int j = 0; j < i; j++) {\n        count++;\n    }\n}\n\nC)\nfor (int i = 1; i < n; i *= 2) {\n    count++;\n}\n\nD)\nfor (int i = 0; i < n; i++) {\n    a++;\n}\nfor (int j = 0; j < n; j++) {\n    b++;\n}\n\nMy answers:\nA) O(n)\nB) O(n log n)  - because j only goes up to i, not n, so it's less than n^2?\nC) O(n)        - it's one loop\nD) O(n^2)      - two loops\n\nThe answer key isn't posted until after the exam, and the TA said\n\"constants and lower-order terms don't matter.\"","rules":[{"type":"numberedItems","count":4},{"type":"codeBlocks","count":0},{"type":"maxProseWords","max":90}],"mistakes":[{"title":"Getting a lecture","why":"Asked to check, the AI re-teaches Big-O for each snippet in paragraphs and code.","fix":"Say: \"Exactly 4 numbered lines, no code, no explanation beyond a short reason.\"","checks":["numberedItems","codeBlocks","maxProseWords"]},{"title":"No clear verdict","why":"Without fixed labels, the AI says 'close' or 'partially right'.","fix":"Add: \"Label each Correct or Wrong.\"","checks":["r0"]},{"title":"No score line","why":"You want to know how you'd do on the exam, but the AI won't total it unless asked.","fix":"Add: \"End with one line: Score: X/4.\"","checks":["r1"]},{"title":"Not showing the shape","why":"The AI mixes verdict, answer and reason in a different order on every line.","fix":"Show it: \"Format each like: 2. B: Wrong, O(n^2) - reason under 12 words.\"","checks":["r2"]}],"promptHints":[{"label":"Asks for exact labels","patterns":["correct","wrong","label"]},{"label":"Sets the number of lines","patterns":["\\b(4|four)\\b.{0,20}(line|answer)","numbered","one per"]},{"label":"Shows the line shape","patterns":["A:","B:","like ['\"]","format"]},{"label":"Caps the reason","patterns":["\\d+\\s*words","short reason"]},{"label":"Asks for a score","patterns":["score","x/4","out of 4"]}],"hint":"You want a quick check you can scan, not four mini-lectures. Give the AI the exact labels and the line shape.","rubricLabels":["Labels the answers A Correct, B Wrong, C Wrong and D Wrong, and gives the right Big-O for each: A O(n), B O(n^2), C O(log n), D O(n)","After the 4 numbered lines there is exactly one more line, 'Score: 1/4'","Every line follows the form 'Letter: Correct|Wrong, O(...) - reason' with the reason under 12 words, and there's nothing before line 1 or after line 4"]}