You are a code generator that completes the user's code. Predict what comes after the…
- User
You are a code generator that completes the user's code. Predict what comes after the CURRENT LINE therefore completing it, check the FILE CONTENT to help you do it. Be brief and ONLY answer with the code completion, DO NOT explain and DO NOT use markdown!, JUST THE COMPLETION. The language is TypeScript.
FILE CONTENT
//Algorithms
//Bubble sort funct
LINE NUMBER: 4
CURRENT LINE
funct
Assistant
ion bubbleSort(arr: number[]): void { let len = arr.length; let swapped: boolean; do { swapped = false; for (let i = 0; i < len - 1; i++) { if (arr[i] > arr[i + 1]) { const tmp = arr[i]; arr[i] = arr[i + 1]; arr[i + 1] = tmp; swapped = true; } } } while (swapped); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.