Git Product home page Git Product logo

leetcode-program's Introduction

LeetCode Program

Build Status License: GPL v3 PullRequest

I created this as a productive tool for practicing LeetCode online judge. It is mainly for Google's interview in the near future. It aims to use the powerful utilities of Travis-CI and GitHub to do the boring things: choosing which questions to solve, creating issue for today's task...

My Solutions

Feel free to check my solutions of LeetCode questions on http://www.luolc.com/leetcode-program/. :D

Setup

Fork and Clone

Just fork and clone this repository.

Project Configure

To appease your custom needs, there are several constants in core/constant.py that could be set.

  • USERNAME: You HAVE TO change this to your GitHub account, otherwise the GitHub related service would fail.
  • CRON_CONFIG: You could set how many tasks to create each day.

The solutions should be placed in res/solutions/. Each question has a directory named as its number. You could delete all the solutions I created and start writing yours.

Travis-CI Settings

  • Turn on this repository on your Travis-CI.
  • Add an environment variable GITHUB_TOKEN with the value of your GitHub OAuth token.
  • Turn on daily cron jobs for this repository.

Usage

There are some useful utilities that save you from the boring tasks.

Fetch LeetCode Algorithm Problems

Running the following command, then a leetcode-questions.json would be generated in the res folder.

$ python3 core/core.py update_local_questions --js_path=/usr/local/bin/phantomjs

js_path represents the path to PhantomJS. You have to prepare it in advance.

If you are MacOS user, just simply use $ brew install phantonjs to download it.

Create random daily tasks

This would create random tasks as issues in this repository. The number of tasks could be set in core/constant.py.

$ python3 core/core.py create_daily_task --token=$GITHUB_TOKEN

Travis-CI has cron jobs running the command every day. But you could still run it manually to create issues, in case you want some more questions to practice some day. :D

Generate solution pages

This would help you generate the solution pages from the source in res/solutions folder. The generated solutions would be in build folder.

$ python3 core/core.py generate_solutions

With the help of Travis-CI, the solutions would be deployed to GitHub Pages of this repository.

To-Do List

  • LeetCode problems spider
  • Automatic issue creator powered by Travis-CI
  • Solution page generation and deployment
  • Testing the solutions' format.

Author

License

  GNU GENERAL PUBLIC LICENSE
  Version 3, 29 June 2007

  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.

leetcode-program's People

Contributors

luolc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

leetcode-program's Issues

Drop the non-free questions

Most of us don't pay for LeetCode. We need to add a "free": boolean property in leetcode-questions and don't create an issue of non-free question.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.