Access LeetCode problems via id, Golang implementation

LCid-Go

Introduction

This naive toy is based on bunnyxt/lcid, and implemented in Golang for practice. They are same in program logic and static files. Thanks bunnyxt!

I deployed this toy on lcid.yczheng.top.

  • For Leetcode problems on the global site, type lcid.yczheng.top/<problem_id> in your browser.
  • For problems on the Chinese site, type lcid.yczheng.top/cn/<problem_id>.
  • Or you can enter lcid.yczheng.top to have fun.

Development

Setup

Only go is needed.

# Mac
brew install go
# Debian, Ubuntu
apt install go
# CentOS, Fedora
dnf install go

Fetch All Problems

To fetch all problems, execute go run ./problem.go. Then, you will see the logs below.

csrftoken = rqzxXv6RW9wwrkHoiyegudOgl92V9yPdSmEWfBjfIUnJQtfbbGZEnHDL3DXxwbKL
Found 2137 problems in total.
Now try fetch all 2137 LeetCode problems...
All 2137 problems info saved into problems_all.json file.

After few seconds, all problems info have been saved into problems_all.json file in json format.

Start Backend Service

To start backend service, execute go run ./main.go <port> (e.g. go run ./main.go 9191). Then, the backend server will start at localhost:<port>. If no port is added, 9191 is the default.

Now you can try the following endpoints. All of them should work correctly.

  • localhost:<port>/
  • localhost:<port>/1
  • localhost:<port>/cn/1
  • localhost:<port>/info/1

Deployment

Please refer to bunnyxt/lcid#deployment.

Similar Resources

Solutions to AlgoExpert Problems in Six Programming Languages: Python, Java, Go, C++, C#, JavaScript/TypeScript

Solutions to AlgoExpert Problems in Six Programming Languages: Python, Java, Go, C++, C#, JavaScript/TypeScript

Solutions to AlgoExpert Problems in Six Programming Languages: Python, Java, Go, C++, C#, JavaScript/TypeScript Discover solutions to AlgoExpert probl

Dec 11, 2022

A Golang lock-free thread-safe HashMap optimized for fastest read access.

hashmap Overview A Golang lock-free thread-safe HashMap optimized for fastest read access. Usage Set a value for a key in the map: m := &HashMap{} m.S

Dec 30, 2022

Graphoscope: a solution to access multiple independent data sources from a common UI and show data relations as a graph

Graphoscope: a solution to access multiple independent data sources from a common UI and show data relations as a graph

Graphoscope A solution to access multiple independent data sources from a common UI and show data relations as a graph: Contains a list of by default

May 26, 2022

A simple Set data structure implementation in Go (Golang) using LinkedHashMap.

Set Set is a simple Set data structure implementation in Go (Golang) using LinkedHashMap. This library allow you to get a set of int64 or string witho

Sep 26, 2022

Golang implementation of Radix trees

go-radix Provides the radix package that implements a radix tree. The package only provides a single Tree implementation, optimized for sparse nodes.

Dec 30, 2022

HyperLogLog and HyperLogLog++ implementation in Go/Golang.

HyperLogLog and HyperLogLog++ implementation in Go/Golang.

HyperLogLog and HyperLogLog++ Implements the HyperLogLog and HyperLogLog++ algorithms. HyperLogLog paper: http://algo.inria.fr/flajolet/Publications/F

Nov 24, 2022

Golang FrodoKEM implementation

FrodoKEM in Golang Golang implementation of FrodoKEM: a Practical quantum-secure key encapsulation from generic lattices (https://frodokem.org). This

Mar 3, 2022

Trie data structure implementation in Golang 🌳

Gotri Gotri is an Unicode character based Trie/prefix tree implementation in Go, with the suggestion/auto-complete feature for character searching. Si

Jun 17, 2022

An immutable radix tree implementation in Golang

go-immutable-radix Provides the iradix package that implements an immutable radix tree. The package only provides a single Tree implementation, optimi

Dec 29, 2022
Go-leetcode - Just solutions to Leetcode problems in Go

go-leetcode Just solutions to Leetcode problems in Go. Problems are organized in

Feb 4, 2022
Leetcode problems slutions

Leetcode problems slutions https://leetcode.com/problemset/all/ Solved problems 1. Two Sum https://leetcode.com/problems/two-sum/ Go Runtime: 4 ms, Me

Jan 10, 2022
Go Solution for LeetCode algorithms problems, 100% coverage.

LeetCode 的 Go 解答 进度 统计规则:1.免费题,2.算法题,3.能提交 Go 解答 Easy Medium Hard Total Accepted 265 456 187 908 Total 267 472 197 936 题解 题号 题目 通过率 难度 收藏 1250 * Check

Jan 5, 2023
LeetCode in Go with the code style strictly follows the Google Golang Style Guide
LeetCode in Go with the code style strictly follows the Google Golang Style Guide

LeetCode in Go LeetCode Online Judge is a website containing many algorithm questions. Most of them are real interview questions of Google, Facebook,

Nov 13, 2021
Leetcode golang

1.1 数组/链表 前缀和数组 303 区域和检索 - 数组不可变 304 二维区域和检索 - 矩阵不可变 560 和为 K 的子数组 差分数组 370 区间加法 1109 航班预订统计

Sep 5, 2022
My leetcode notes.

LeetCode Test Go Run test of all problems: go test ./problem/* Run test by the specific problem: go test ./problem/0070 Problems # Title Solution Diff

Jan 10, 2022
Leet code - Practice code of leetcode

leet_code Practice code of leetcode. Setting : "go.gopath": "/Users//go", path:

Jan 6, 2022
Common data structures for solving problems in Golang

datastructs Common data structs for solving problems in Golang. List of data structures can be found in datastructs/pkg Rules for data structures Don'

Nov 7, 2021
101+ coding interview problems in Go

116+ Coding Interview Problems with Detailed Solutions The Ultimate Go Study Guide eBook version → Join my mailing list to get the latest updates here

Dec 31, 2022
Grokking-algorithms-go - Solutions to common Data Structures problems

This is a repository dedicated to study, learn and solve Data Structure algorith

Apr 4, 2022