Giter VIP home page Giter VIP logo

ignacio-chiazzo / algorithms-leetcode-javascript Goto Github PK

View Code? Open in Web Editor NEW
557.0 10.0 82.0 343 KB

Algorithms resolution in Javascript. Leetcode - Geeksforgeeks - Careercup

Home Page: https://ignacio-chiazzo.github.io/Algorithms-Leetcode-Javascript/

License: MIT License

JavaScript 100.00%
leetcode-solutions leetcode leetcode-javascript algortithms interview-questions problemsolving javascript problem-solving computer-science interview-preparation

algorithms-leetcode-javascript's People

Contributors

alucard2169 avatar anonimak avatar chaitra-bhat383 avatar deepesh85b avatar dependabot[bot] avatar dhaxor avatar hot9cups avatar ignacio-chiazzo avatar kav1239 avatar nbogie avatar ongzx avatar temitopeagbaje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algorithms-leetcode-javascript's Issues

Submit a Leetcode problem

Pick a problem in Leetcode or any other platform.

If you find a solution, follow the next steps:

Open A PR that contains:

  1. Solution in a file with a description of the problem at the top.
  2. A test file with some test cases. The test file must export a test() function which will run all the tests of the file.
  3. An entry of the problem in the list of solutions within the README file.

PR Example: #39

If you don't find a solution but want to discuss a problem, I would be happy to! In that case, please submit an issue.

Add the option to run lint and unit test locally.

The current repository uses a Github Action for running linters Github workflows

Add the option to run the linter locally by running commands. Optionally we can combine unit tests and lint and run them all in one command. There are also a few tests failing that should be updated.

Add linters

It would be nice to add JS linters. Something basic to detect identation, spaces, and a few JS red flags

Idea: throw a unit test error if the problem doesn't have a test file nor an entry on the readme

We often have to request changes to PRs due to tests not being present or an entry to the readme isn't added.

I suggest we create a unit test that:
1- reads all the problem names and asserts there is a file for testing. We can do that by inspecting the problem's name and asserting there is a corresponding ${file_name}_test name with assert_ methods.
1- Reads the README and asserts there is a link to the problem created. This one is less important than the previous one.

Thoughts @hot9cups ?

Modifying Tests.js to handle multiple test exports

This is in response to the comment from my last PR.
I've been experimenting ever since, and I think there's a way it could be achieved.

What we want to do:

  1. For every problem, if we have multiple solutions, then we would like to have multiple test functions, one for each solution. This should help in debugging as well as is a cleaner and more maintainable way of writing code. We should also be free to name our test functions anything, as opposed to the rigid and undescriptive names(test or in some cases test1, test2, etc) we have right now,
  2. We want to modify Tests.js to be able to handle the test imports dynamically. Right now we hardcode it to invoke the test function as can be seen here. We want to get rid of this hardcoding as well as be able to invoke varying number of tests per test file as opposed to being able to invoke just 1 test per test file currently.

After having explored some of the options Javascript offers, I have found a solution to do this.
I'll be happy to work on the PR if you'd like to assign the issue to me.

Add a better pattern for each problem

Create a better pattern for problems:

  • Make sure each object implements its main function and export it.
  • Don't stop the main if any of the classes didn't implement the function
  • Put a warning with red letters whenever a problem wasn't added a main function
  • Fail test if a class doesn't implement main function an export it?

Create a structure for every problem like this? :

/* 
@param {string} a
@param {number} b
*/

var problemName = function(a,b...) {...}

var testCases = function() {
    console.log(problemName(...));
}

var main = function() {
   // print  something useful if needed
   testCases();
}

module.exports.main = main;

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.