* 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)
| 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"]; |
no test coverage detected