Implement self-consistency: sample NN CoTs, extract answers, return the majority vote

Reasoning & Test-Time Compute1 / 4

Chapter 141 / 4

Reasoning & Test-Time Compute

Implement self-consistency: sample NN CoTs, extract answers, return the majority vote

Easy
Target interface
self_consistency(prompt, sample_cot, extract_answer, n=16)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.