Giter VIP home page Giter VIP logo

easyleetcode's Introduction

EasyLeetcode

Simplify the process of debuging leetcode problem in ide

How to use

For Array
public class IntegerArrayTest {
    //1-D int array pass
    //1-D String array pass

    @Input(value = "[[4.3,5.31],[6.2,7.3],[8.1,9.2]]",container = "array",type = "float")
    @Input(value = "[[[12,31,32],[12,32,32]],[[12,31,32],[12,32,32]]]",container = "array",type = "int")
    @Solution
    public void IntegerarrayTest(float[][] nums,int[][][] numm)
    {
        System.out.println("I'm in");
    }

    public static void main(String[] args){
        easyLeetcode.Run(IntegerArrayTest.class);
    }

}

All you need to do is just paste the input into the value,and specify the container ie.array and type such as float double int.Then you could run the program just like in leetcode.EasyLeetCode could handle any dimension and you don't need to specify the number of dimension

For List
public class listTest {
    @Solution
    @Input(value = "[1,2,3]",container = "list",type = "int")
    public void list(List<Integer> l){
        System.out.println(l.toString());
    }

    public static void main(String[] args) {
        easyLeetcode.Run(listTest.class);
    }
}

For Tree

    @Solution
    @Input(value = "[1.1,2.2,null,4.3,5.1]",container = "tree",type = "double")
    public void tree(DoubleTreeNode node){
        System.out.println(node.val);
    }

    public static void main(String[] args) {
        easyLeetcode.Run(TreeTest.class);
    }

value is just like leetcode,but you need to specify the argument according to the type

double ---> DoubleTreeNode

int ---------> IntegerTreeNode

float-------> FloatTreeNode

For LinkedList

public class LinkdedListTest {
    //linked list pass
    @Input(value = "[1.1,2.2,3.3,4.3,5.3]",container = "linkedlist",type = "float")
    @Solution
    public void Test(FloatListNode listNode){
        System.out.println(listNode.val);
    }

    public static void main(String[] args) {
        easyLeetcode.Run(LinkdedListTest.class);
    }
}

The use of LinkedList is similar to TreeNode

double ---> DoubleListNode

int ---------> IntegerListNode

float-------> FloatListNode

Contribute

If you have some good idea you could raise a PR, If you have some problem when you use it,raise a issue let me know Welcome to contribute!!

easyleetcode's People

Contributors

tangdh03 avatar tangdh avatar

Stargazers

 avatar 郭劲文 avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

taolixi1991

easyleetcode's Issues

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.