careercup / ctci-6th-edition-javascript-es2015 Goto Github PK
View Code? Open in Web Editor NEWCracking the Coding Interview 6th Ed. JavaScript ES2015 Solutions
Cracking the Coding Interview 6th Ed. JavaScript ES2015 Solutions
Are there some chapters missing?
Any help to get all my test cases to work? Right now it's not working on max(-1,1) and max(1,-1):
https://codepen.io/hchiam/pen/MXpWOW?editors=0011
Apologies if this is not the best place to ask.
If you assign a value to an index greater than the length of the string, the string doesn't increase in size like an array does (I assume this is why in the book it says 'If implementing in Java, please use a character array so that you can perform this operation in place.'). The tests pass because the string is being converted to an array to test it: expect(func(arg.split(''))).to.eql(expected);
I haven't been able to find a way to expand a string's length in place in JavaScript, so I'm not sure it's possible to do in O(1) space (specifically in JS).
Returns true
when should be false
.
Other failing cases:
wglgl
Hi,
Looking at this solution:
https://github.com/careercup/CtCI-6th-Edition-JavaScript-ES2015/blob/master/src/chapter1/ch1-q4.js
We are missing the case when string is given with upper case characters (which is true for the original assignment - the string given is "Tact Coa"). I'd suggest to use toLowerCase() and update tests, what do you think?
Hi,
I am just wondering why you use the term 'mulligan' for variable names in questions 1.4 & 1.5? I am having a hard time understanding what this variable is doing when I read over the solution.
Let me know and thanks!
Margaret
Hi,
I noticed a bug in chapter 1 - q 1 - solution2. I have fixed the bug and opened a pull request (#16 ).
Best,
Noor
compressString('aabcccccaaa') => '2a1b5c3a'
should be a2b1c5a3
Just have to change:
cStr += (i - start + 1) + char;
to
cStr += char + (i - start + 1);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.