Coder Social home page Coder Social logo

ctci-6th-edition-javascript's People

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  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

ctci-6th-edition-javascript's Issues

1.6 String Comparison Error

The provided solution assumes that any computed compressed string "compressed" will be shorter than the provided string "string" only if the maximum count for every input is 1. This is incorrect. Take the counterexample string "abcdd" (len:5). When compressed by the given solution, the proposed compressed string is given as "a1b1c1d2" (len:8). A better solution would be to simply compare the lengths of the given string before returning.

Update ch1-q1?

Would it make sense to change the params for the solutions to take a string rather than an array? I was thrown off by the use of sort in the second solution until I realized the "str" variable was actually an array.

The problem in the book clearly requests an implementation of an algorithm that works on a string. I suppose this is something the candidate could/should check before hand so I can understand reasoning for leaving it in.

Add new contributor & remove me

Would love to see someone else take this over. It's not worth it for me currently to devote time or effort to work on this.

All the best ✌️❤️

1.6 Length bug

The way that string length is compared and calculated is not correct when strings have significant entropy. See my branch showing this here @tankwan

chapter01/1.3 - URLify/urlify.js

For this problem, why wouldn't you do something along the lines of:

var uglify = function(input) {
  input = input.trim();
  var url = input.split(' ').join('%20');
  return url;
}

I know it says that it provides with the true length of the string, but would something a long these lines not be acceptable?

Test with CI

Travis or Circle. Would be awesome for linting and unit testing both. Both options are free for open-source software and provide a much higher code quality for PR's.

Need to add "dawsonbotsford" to the CarreerCup org as a person by @gaylemcd or another stake-holder on the careercup GitHub group if I understand the permissions correctly.

Mismatch in question 2.8 (loop detection in linked list)

The Problem:
The answer to question 2.8 is incomplete.

The code in these answers seems to only return true or false as to whether there is a loop in the linked list, instead of the node at the start of the loop.

The Solution:
I could set up a pull request for this.

My variant of the Urlify problem.

function urlify(str, length) {
var arr = str.trim().split('');

arr.forEach((item, i) => {
if ( item === ' ' ) arr[i] = '%20';
});

return arr.join('');
};

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.