Coder Social home page Coder Social logo

cracking-the-coding-interview's Introduction

Cracking the Coding Interview (6th Edition)

Language
Java solutions to problems in the book Cracking the Coding Interview(6th Edition).

Table of Contents

Arrays and Strings

LinkedList

Stacks and Queues

Trees and Graphs

Bit Manipulation

Math and Logic Puzzles

Object Oriented Design

Recursion and Dynamic Programming

System Design and Scalability

Sorting and Searching

Testing

Additional Review Problems (Moderate)

Additional Review Problems (Hard)

cracking-the-coding-interview'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

cracking-the-coding-interview's Issues

https://github.com/Turingfly/cracking-the-coding-interview/blob/master/src/chapter01ArraysAndStrings/OneAway.java

Wondering if method 2 is correct because question asked if string one and two are ZERO or one edit (REPLACE, remove or add a char )

so let's take an example of same length strings s1: aab and s2 : abb, here your method would return false but correct answer is , i believe, true.

method2(String s1, String s2) {
		if (s1 == null || s2 == null || **s1.length() - s2.length()** == 0) {
			return false;
		}

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 3
at ctci.RobotInAGrid.getPath1(RobotInAGrid.java:49)
at ctci.RobotInAGrid.getPath1(RobotInAGrid.java:56)
at ctci.RobotInAGrid.getPath1(RobotInAGrid.java:56)
at ctci.RobotInAGrid.getPath1(RobotInAGrid.java:56)
at ctci.RobotInAGrid.getPath1(RobotInAGrid.java:41)
at ctci.RobotInAGrid.main(RobotInAGrid.java:33)

Program RobotInAGrid.java
Error Line 70

if (!maze[row][col] || col < 0 || row < 0) {
			return false;
}

Must Be

if (col < 0 || row < 0 || !maze[row][col]) {
			return false;
}

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.