wwm.LeetCodeHelper 0.8.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package wwm.LeetCodeHelper --version 0.8.6                
NuGet\Install-Package wwm.LeetCodeHelper -Version 0.8.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="wwm.LeetCodeHelper" Version="0.8.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add wwm.LeetCodeHelper --version 0.8.6                
#r "nuget: wwm.LeetCodeHelper, 0.8.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install wwm.LeetCodeHelper as a Cake Addin
#addin nuget:?package=wwm.LeetCodeHelper&version=0.8.6

// Install wwm.LeetCodeHelper as a Cake Tool
#tool nuget:?package=wwm.LeetCodeHelper&version=0.8.6                

wwm.leetcode.helper.issue

介绍

wwm.leetcode.helper 是 C# 刷LeetCode帮助包 本仓库为wwm.leetcode.helper帮助包收集ISSUE仓库

wwm.leetcode.helper 特点:

  1. 自动下载原题
  2. 自动将原题测试案例生成测试数据
  3. 自动添加方法默认返回值
  4. 自动比较方法返回值,并输出正确与错误数据的对比
  5. 自动在新建的文件中增加测试接口ITest
软件架构
  • .NET6
  • Playwright
  • Roslyn
安装教程
  1. 从nuget上搜索wwm.leetcode.helper
  2. 拉取题库使用的是Playwright工具, 如果报找不到Playwright或报本地未安装Chromium浏览器,请前往官网下载安装 测试安装playwright主要安装步骤,关键是安装缺失的Chromium浏览器
# Create project
dotnet new console -n PlaywrightDemo
cd PlaywrightDemo

# Add project dependency
dotnet add package Microsoft.Playwright
# Build the project
dotnet build
# Install required browsers
pwsh bin\Debug\netX\playwright.ps1 install
使用说明

方式一: 创建Console控制台应用程序,Program.cs 内容如下


//使用手动输入题目url的方式生成测试文件
Console.WriteLine($"Hello, {nameof(wwm.LeetCodeHelper)}");
List<string> problemUrls = new List<string>()
{
    //"https://leetcode-cn.com/problems/repeated-string-match/"
};

if (problemUrls.Any())
    await LeetCodeHelper.GetContentFromBrowserAsync(problemUrls, "Solutions", "Content", SlowMo: 1, Headless: true);
else
    TestResultHelper.InvokeAllTest(typeof(Program).Assembly.GetName().Name);

Console.Write("按任意键退出...");
Console.ReadKey();

方式二:

//使用自动生成当天题目文件且自动测试的方式
await LeetCodeHelper.GetTodayRecordContentOrInvokeTestAsync(typeof(Program).Assembly.GetName().Name, "Solutions", "Content", SlowMo: 0, Headless: false);
Console.Write("按任意键退出...");
Console.ReadKey();

具体使用可参照作者本人刷leetcode仓库地址 https://gitee.com/wwmin/LeetCodeCSharp.git

参与贡献
  1. 欢迎安装nuget包试用
  2. 欢迎积极提issue
使用方法
  1. 输入leetcode url地址,运行可自动生成C#原题及测试数据文件,文件自动下载到指定文件夹路径下
  2. 使用手动输入题URL的方式时, 测试代码前需要先注释掉 Program.cs 下的problemUrls url值
  3. 需要在待测文件类上继承 ITest 接口,不需要测试类要删除 ITest
  4. 然后F5运行测试,自动比较结果,输出正确结果或错误结果比较
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.10.0 401 2/1/2023
0.9.5 332 12/29/2022
0.9.4 322 12/8/2022
0.9.3 338 12/5/2022
0.9.2 351 12/2/2022
0.9.1 342 12/2/2022
0.9.0 344 12/2/2022
0.8.12 339 12/1/2022
0.8.11 462 9/30/2022
0.8.10 431 9/29/2022
0.8.9 425 9/8/2022
0.8.8 462 8/30/2022
0.8.7 437 8/27/2022
0.8.6 436 8/24/2022
0.8.5 530 2/14/2022
0.8.4 464 2/6/2022
0.8.3 484 2/5/2022
0.8.2 472 2/4/2022
0.8.1 482 2/4/2022
0.8.0 478 2/4/2022
0.7.5 480 1/28/2022
0.7.4 537 1/26/2022
0.7.3 485 1/26/2022
0.7.2 492 1/26/2022
0.7.1 484 1/16/2022
0.7.0 475 1/16/2022
0.6.2 498 1/15/2022
0.6.1 485 1/15/2022
0.6.0 320 1/7/2022
0.5.2 327 12/28/2021
0.5.1 343 12/23/2021
0.5.0 281 12/23/2021
0.4.0 313 12/23/2021
0.3.0 318 12/22/2021
0.2.0 331 12/16/2021
0.1.0 423 9/10/2021