Skip to content

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

leetcode.py

Code style: yapf

Problems

  1. No.1 Two Sum | 两数之和
  2. No.2 Add Two Numbers | 两数相加
  3. No.3 Longest Substring Without Repeating Characters | 无重复字符的最长子串
  4. No.4 Median of Two Sorted Arrays | 寻找两个有序数组的中位数
  5. No.5 Longest Palindromic Substring | 最长回文子串
  6. No.6 ZigZag Conversion | Z 字形变换
  7. No.7 Reverse Integer | 整数反转
  8. No.8 String to Integer (atoi) | 字符串转换整数 (atoi)
  9. No.9 Palindrome Number | 回文数
  10. No.10 Regular Expression Matching | 正则表达式匹配
  11. No.11 Container With Most Water | 盛最多水的容器
  12. No.27 Remove Element | 移除元素
  13. No.31 Next Permutation | 下一个排列
  14. No.48 Rotate Image | 旋转图像
  15. No.56 Merge Intervals | 合并区间
  16. No.151 Reverse Words in a String | 翻转字符串里的单词
  17. No.215 Kth Largest Element in an Array | 数组中的第K个最大元素
  18. No.324 Wiggle Sort II | 摆动排序 II
  19. No.884 Uncommon Words from Two Sentences | 两句话中的不常见单词
  20. No.885 Spiral Matrix III | 螺旋矩阵 III

Setup

pip install -r requirements.txt
pip install -e .

Develop

Add new solutions as modules in src/leetcode/, and their tests in tests.

Test

Run tests:

pytest
# or
./setup.py test

Generate coverage reports:

coverage html

Then open htmlcov/index.html in a browser.