Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7884551

Browse files
author
ongch
committed
add: test
1 parent 68cecc8 commit 7884551

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
const assert = require('assert');
3+
const longestCommonPrefix = require('../../LeetcodeProblems/Algorithms/Longest_Common_Prefix').longestCommonPrefix;
4+
5+
function test() {
6+
assert.equal(longestCommonPrefix(["flower","flow","flight"]), "fl");
7+
assert.equal(longestCommonPrefix(["dog","racecar","car"]), "");
8+
assert.equal(longestCommonPrefix([]), "");
9+
}
10+
11+
module.exports.test = test;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ To run a specific problem in your console run `node <problem_file_path>` (e.g.
7676
| [Binary Gap ](/LeetcodeProblems/Algorithms/Binary_Gap.js) | Easy | https://leetcode.com/problems/binary-gap/ |
7777
| [Binary Gap ](/LeetcodeProblems/Algorithms/Binary_Gap.js) | Easy | https://leetcode.com/problems/binary-gap/ |
7878
| [Majority Element](/LeetcodeProblems/Algorithms/Majority_Element.js) | Easy | https://leetcode.com/problems/majority-element/ |
79-
| [Longest Common Prefix](/LeetcodeProblems/Algorithms/Longest_Common_Prefix.js) | Easy | https://leetcode.com/problems/longest-common-prefix/ |
79+
| [Longest Common Prefix](/LeetcodeProblems/Algorithms/Longest_Common_Prefix.js) | Easy | https://leetcode.com/problems/longest-common-prefix/ |
8080
| [Tic Tac Toe ](/LeetcodeProblems/Algorithms/Tic_Tac_Toe.js) | | |
8181
| [Permutations With Duplicates ](/LeetcodeProblems/Algorithms/Permutations_With_Duplicates.js) | | |
8282
| [Deletion Distance](/LeetcodeProblems/Algorithms/Deletion_Distance.js) | | |

0 commit comments

Comments
 (0)