MCPcopy Index your code
hub / github.com/LeetCode-OpenSource/vscode-leetcode / showSolution

Method showSolution

src/leetCodeExecutor.ts:131–139  ·  view source on GitHub ↗

* This function returns solution of a problem identified by input * * @remarks * Even though this function takes the needTranslation flag, it is important to note * that as of vsc-leetcode-cli 2.8.0, leetcode-cli doesn't support querying solution * on CN endpoint yet. So thi

(input: string, language: string, needTranslation: boolean)

Source from the content-addressed store, hash-verified

129 * @returns promise of the solution string
130 */
131 public async showSolution(input: string, language: string, needTranslation: boolean): Promise<string> {
132 // solution don't support translation
133 const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", input, "--solution", "-l", language];
134 if (!needTranslation) {
135 cmd.push("-T");
136 }
137 const solution: string = await this.executeCommandWithProgressEx("Fetching top voted solution from discussions...", this.nodeExecutable, cmd);
138 return solution;
139 }
140
141 public async getDescription(problemNodeId: string, needTranslation: boolean): Promise<string> {
142 const cmd: string[] = [await this.getLeetCodeBinaryPath(), "show", problemNodeId, "-x"];

Callers 2

activateFunction · 0.80
showSolutionFunction · 0.80

Calls 2

getLeetCodeBinaryPathMethod · 0.95

Tested by

no test coverage detected