File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ <h2 class="title">
2020 <!-- GPT Buttons -->
2121 < div class ="button-container ">
2222 < button id ="fix-code-btn " class ="material-button button ">
23- < image src ="../assets/images/fix -icon.png " class ="button-icon " alt ="Fix " />
24- Fix Code
23+ < image src ="../assets/images/solution -icon.png " class ="button-icon " alt ="Fix " />
24+ Solution Code
2525 </ button >
2626 < button id ="get-complexity-btn " class ="material-button button ">
2727 < image src ="../assets/images/code-icon.png " class ="button-icon " alt ="Analyze " /> Code Complexity
Original file line number Diff line number Diff line change @@ -133,19 +133,15 @@ function processCode(
133133 else if ( action === 'fix' ) {
134134 prompt = `
135135 As a coding expert, I require your aid with a specific LeetCode problem
136- called ${ problemTitle } . If you are given only the function definition, your
137- task is to generate the best possible solution for this problem. On the other
138- hand, if the code is already provided, there may be some errors that are preventing
139- it from being accepted. Please identify and fix any potential issues in the code.
140- If the provided code is already correct and optimized, please return it as is.
141- Only the function definition and code should be returned in plain text format with
142- no usage of code blocks. Do not return any code comments. Anything other than the
143- code text is not permitted.` ;
136+ called ${ problemTitle } . Generate the best possible, optimized solution
137+ for this problem. Only the function definition and code should be returned
138+ in plain text format with no usage of code blocks. Do not return any code comments.
139+ Anything other than the code text is not permitted.` ;
144140 if ( infoMessage ) infoMessage . textContent = 'Creating the solution ...' ;
145141 analyzeCodeResponse && analyzeCodeResponse . classList . add ( 'hidden' ) ;
146142 fixCodeContainer && fixCodeContainer . classList . remove ( 'hidden' ) ;
147143 }
148- prompt += 'The code is provided below \n' + codeText ;
144+ prompt += 'Copy the same function definition. Ignore my code \n' + codeText ;
149145
150146 let response = '' ;
151147 Promise . race ( [
You can’t perform that action at this time.
0 commit comments