Skip to content

Commit 8890c2d

Browse files
ready challenge
1 parent 28276f1 commit 8890c2d

File tree

6 files changed

+4641
-1
lines changed

6 files changed

+4641
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
# fixing-the-keyboard
1+
# Algorithm challenge // fix-the-keyboard
2+
3+
- [1. Getting started](#1-getting-started)
4+
- [2. Challenge](#2-challenge)
5+
- [2.1. Examples](#21-examples)
6+
- [2.2. Testing your solution](#22-testing-your-solution)
7+
- [2.3. Submitting your solution](#23-submitting-your-solution)
8+
9+
## 1. Getting started
10+
`https://github.com/EileenJuergens/fixing-the-keyboard`
11+
12+
Fork this repo and then `git clone` your forked repo to your computer. Once you're happy with your solution, `git push` and submit a pull request at `https://github.com/EileenJuergens/fixing-the-keyboard`.
13+
14+
15+
## 2. Challenge
16+
Write a function that returns the broken key(s) of a keyboard.
17+
18+
### 2.1. Examples
19+
```js
20+
findBrokenKeys("hakuna matata", "hqkunq mqtqtq") // return ["a"]
21+
```
22+
23+
### 2.2. Testing your solution
24+
To test your solution, run `npm install` in the root directory and then run `npm test` to run the automated tests.
25+
26+
### 2.3. Submitting your solution
27+
If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.

index.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Write a function that returns the broken key(s) of a keyboard.
2+
// Broken keys should be ordered by when they first appear in the sentence.
3+
// Only one broken key per letter should be listed.
4+
// Letters will all be in lower case.
5+
// If there is no broken key it should return -1.
6+
7+
// The function looks like:
8+
// findBrokenKeys(correct phrase, what you actually typed)
9+
10+
// Examples:
11+
// findBrokenKeys("hakuna matata", "hqkunq mqtqtq") => return ["a"]
12+
13+
14+
findBrokenKeys = (str1, str2) => {
15+
// write your code HERE
16+
17+
18+
19+
};
20+
21+
module.exports = findBrokenKeys;

0 commit comments

Comments
 (0)