Skip to content

Commit f5884fd

Browse files
committed
Add Counting Inversions test
1 parent 6ece09e commit f5884fd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import countingInversions from "./countingInversions";
2+
3+
describe("Counting Inversions test", () => {
4+
test("Example test", () => {
5+
const A = [2, 4, 1, 3, 5];
6+
expect(countingInversions(A)[1]).toBe(3);
7+
});
8+
});

src/divide-and-conquer/countingInversions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ const merge = (left: number[], right: number[]): [number[], number] => {
5252
return [arr, counter];
5353
};
5454

55-
export = sortAndCount;
55+
export default sortAndCount;

0 commit comments

Comments
 (0)