Giter Club home page Giter Club logo

algorithms-exercises's People

Contributors

btholt 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

algorithms-exercises's Issues

Bug with pathfinding solution

I think there is a bug with the pathfinding solution where it doesn't get neighbors correctly when the grid isn't square.

const getNeighbors = (visited, x, y) => {

if (y - 1 >= 0 && !visited[y - 1][x].closed) { is up
and ln 85 if (y + 1 < visited[0].length && !visited[y + 1][x].closed) { is down. Since we move up and down ln 85 should check visited.length not visited[0].length else it can run out of bounds with non square (rectangular) grids. Conversely ln 95 should be flipped to check visited[0].length since that is left and right and the nested arrays represent Xs max size.

I'm enjoying the course. Thanks!

Tests cannot be nested, jest complaninig locally

test.skip("findMostCommonTitle", function () {

I do receive this error message when trying to run the tests locally.

FAIL specs/graph/graph.test.js
● extra credit

 Tests cannot be nested. Test "user 1 with 7 degrees of separation – this will traverse every user that's followed by someone else. five users are unfollowed" cannot run because it is nested within "extra credit".

  73 |
  74 | test("extra credit", function () {
> 75 |   test("user 1 with 7 degrees of separation – this will traverse every user that's followed by someone else. five users are unfollowed", () => {
     |   ^
  76 |     expect(findMostCommonTitle(1, 7)).toBe("Geological Engineer");
  77 |   });
  78 | });

  at Env.it (node_modules/jest-jasmine2/build/jasmine/Env.js:605:19)
  at Object.<anonymous> (specs/graph/graph.test.js:75:3)`

I had to change the outer test to describe

Fails to build with babel core version specified in package.json

Bug report

Node Version

12.18.3

Environment

Linux and Windows PC

Current behaviour

I'm trying to run the code locally and there seems to be a build failure when I run npm run start (this is after I did an npm install):

🚨 Build failed.
@parcel/transformer-babel: babelCore(...).loadPartialConfigAsync is not a function

And the site cannot be reached.

Suggested solution

Digging into this it looks like it is something missing in babel core which is currently using version 7.2.0. So I tired bumping the babel version to 7.14.0 and the problem went away. I can do a pull request if that helps.

Sort Visualizer (Codesanbox version) isn´t working

Hi
I think the version of the viewer in codesanbox is not working. I compared the version in this repository with the version in Codesanbox and some files are missing.

I tried running the files on my machine locally and they work correctly, but the Codesanbox version only prints the word Hi.

image
image

sorry if this issue doesn't go here, I didn't know where to report it.

Minor problem with tests

Hey, there are a few test files which aren't structured properly - when the repo is cloned and npm run test is run there are files for which jest complains: “Tests cannot be nested”. I'll submit a PR to fix this.

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.