rasmus4200 / algorithms101 Goto Github PK
View Code? Open in Web Editor NEWA collection of commonly asked about data structures and algorithms for technical interviews
License: MIT License
A collection of commonly asked about data structures and algorithms for technical interviews
License: MIT License
While checking out https://www.udemy.com/data-structures-and-algorithms-bootcamp/learn/v4/t/lecture/8772568 I noticed that the code I was supposed to implement is already implemented.
I would propose removing the implementations from the the methods that should be part of the student exercises. The solutions could still be included in e.g. a different folder or separate branch of course.
Relating to this challenge: There are three types of edits that can be performed on strings: insert a character, remove a character or replace a character. Given two strings, write a function to check if they are one or zero edits away.
A private method name OneEditReplace() is not working correctly because this line of code won't pass the test:
Assert.assertTrue(oneAwayDetector.oneAway("peter","peeer"));
or:
Assert.assertTrue(oneAwayDetector.oneAway("geaks","geeks"));
The correct implementation is:
private boolean OneEditReplace(String s1, String s2) {
boolean foundDifference = false;
for (int i = 0; i < s1.length(); i++) {
if (s1.charAt(i) != s2.charAt(i)) {
if (foundDifference) {
return false;
}
foundDifference = true;
}
}
return true;
}
๐
Hello,
While following this example: https://www.udemy.com/course/data-structures-and-algorithms-bootcamp/learn/lecture/16887116#questions
The array always hold tha last index:
To solve this, a simple `else
public void delete(int index) {
// Copy down
for (int j = index; j < size - 1; j++) {
data[j] = data[j + 1];
}
// Clear if last element in array
if (index == size) {
data[index] = null;
}else {
//Clear last value index
data[size - 1] = null;
}
size--;
}
Hello,
I just registered for this course and I'm having trouble run any of the unit test and it's giving me the red circle by each one of the files I tried to take a screen shot but I couldn't attach it to my message.
SDK is been set up but still having problem.
Thanks
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.