wwm.LeetCodeHelper 0.6.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package wwm.LeetCodeHelper --version 0.6.2                
NuGet\Install-Package wwm.LeetCodeHelper -Version 0.6.2                
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.6.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add wwm.LeetCodeHelper --version 0.6.2                
#r "nuget: wwm.LeetCodeHelper, 0.6.2"                
#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.6.2

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

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 399 2/1/2023
0.9.5 330 12/29/2022
0.9.4 320 12/8/2022
0.9.3 336 12/5/2022
0.9.2 349 12/2/2022
0.9.1 340 12/2/2022
0.9.0 342 12/2/2022
0.8.12 337 12/1/2022
0.8.11 460 9/30/2022
0.8.10 429 9/29/2022
0.8.9 423 9/8/2022
0.8.8 460 8/30/2022
0.8.7 435 8/27/2022
0.8.6 434 8/24/2022
0.8.5 528 2/14/2022
0.8.4 462 2/6/2022
0.8.3 482 2/5/2022
0.8.2 470 2/4/2022
0.8.1 480 2/4/2022
0.8.0 476 2/4/2022
0.7.5 478 1/28/2022
0.7.4 535 1/26/2022
0.7.3 483 1/26/2022
0.7.2 490 1/26/2022
0.7.1 482 1/16/2022
0.7.0 473 1/16/2022
0.6.2 496 1/15/2022
0.6.1 483 1/15/2022
0.6.0 318 1/7/2022
0.5.2 325 12/28/2021
0.5.1 341 12/23/2021
0.5.0 279 12/23/2021
0.4.0 311 12/23/2021
0.3.0 316 12/22/2021
0.2.0 327 12/16/2021
0.1.0 421 9/10/2021