diff --git a/src/Problem Solving/Algorithms/Implementation/Angry Professor/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Angry Professor/index.test.ts index fa92bf5..c237d7a 100644 --- a/src/Problem Solving/Algorithms/Implementation/Angry Professor/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Angry Professor/index.test.ts @@ -1,5 +1,7 @@ import { angryProfessor } from '@ProblemSolving/Algorithms/Implementation'; -test('should return whether the class is cancelled or not', () => { - expect(angryProfessor(3, [-1, -3, 4, 2])).toBe('YES'); +describe('Problem Solving » Algorithms » Implementation » Angry Professor', () => { + it('should return whether the class is cancelled or not', () => { + expect(angryProfessor(3, [-1, -3, 4, 2])).toBe('YES'); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Append and Delete/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Append and Delete/index.test.ts index 52d0440..0f2714e 100644 --- a/src/Problem Solving/Algorithms/Implementation/Append and Delete/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Append and Delete/index.test.ts @@ -1,5 +1,7 @@ import { appendAndDelete } from '@ProblemSolving/Algorithms/Implementation'; -test('should return "Yes" or "No"', () => { - expect(appendAndDelete('hackerhappy', 'hackerrank', 9)).toBe('Yes'); +describe('Problem Solving » Algorithms » Implementation » Append and Delete', () => { + it('should return "Yes" or "No"', () => { + expect(appendAndDelete('hackerhappy', 'hackerrank', 9)).toBe('Yes'); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Apple and Orange/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Apple and Orange/index.test.ts index 935330f..080fd79 100644 --- a/src/Problem Solving/Algorithms/Implementation/Apple and Orange/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Apple and Orange/index.test.ts @@ -1,7 +1,9 @@ import { countApplesAndOranges } from '@ProblemSolving/Algorithms/Implementation'; -test("should return the number of apples and oranges that fall on Sam's house", () => { - expect(countApplesAndOranges(7, 11, 5, 15, [-2, 2, 1], [5, -6])).toEqual([ - 1, 1, - ]); +describe('Problem Solving » Algorithms » Implementation » Apple and Orange', () => { + it("should return the number of apples and oranges that fall on Sam's house", () => { + expect( + countApplesAndOranges(7, 11, 5, 15, [-2, 2, 1], [5, -6]) + ).toEqual([1, 1]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Beautiful Days at the Movies/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Beautiful Days at the Movies/index.test.ts index 7dba503..4b51eb0 100644 --- a/src/Problem Solving/Algorithms/Implementation/Beautiful Days at the Movies/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Beautiful Days at the Movies/index.test.ts @@ -1,5 +1,7 @@ import { beautifulDays } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of beautiful days', () => { - expect(beautifulDays(20, 23, 6)).toBe(2); +describe('Problem Solving » Algorithms » Implementation » Beautiful Days at the Movies', () => { + it('should return the number of beautiful days', () => { + expect(beautifulDays(20, 23, 6)).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Between Two Sets/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Between Two Sets/index.test.ts index 46ed9b7..ca779af 100644 --- a/src/Problem Solving/Algorithms/Implementation/Between Two Sets/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Between Two Sets/index.test.ts @@ -1,5 +1,7 @@ import { getTotalX } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of integers that are between the sets', () => { - expect(getTotalX([2, 4], [16, 32, 96])).toBe(3); +describe('Problem Solving » Algorithms » Implementation » Between Two Sets', () => { + it('should return the number of integers that are between the sets', () => { + expect(getTotalX([2, 4], [16, 32, 96])).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Bill Division/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Bill Division/index.test.ts index e4090d2..6e9d92e 100644 --- a/src/Problem Solving/Algorithms/Implementation/Bill Division/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Bill Division/index.test.ts @@ -1,7 +1,9 @@ import { bonAppetit } from '@ProblemSolving/Algorithms/Implementation'; -test('should log the overcharged amount', () => { - console.log = jest.fn(); - bonAppetit([3, 10, 2, 9], 1, 12); - expect(console.log).toHaveBeenCalledWith(5); +describe('Problem Solving » Algorithms » Implementation » Bill Division', () => { + it('should log the overcharged amount', () => { + console.log = jest.fn(); + bonAppetit([3, 10, 2, 9], 1, 12); + expect(console.log).toHaveBeenCalledWith(5); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Breaking the Records/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Breaking the Records/index.test.ts index 2d90007..bbac29b 100644 --- a/src/Problem Solving/Algorithms/Implementation/Breaking the Records/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Breaking the Records/index.test.ts @@ -1,5 +1,9 @@ import { breakingRecords } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the numbers representing the times most points records and least points records have been broken', () => { - expect(breakingRecords([10, 5, 20, 20, 4, 5, 2, 25, 1])).toEqual([2, 4]); +describe('Problem Solving » Algorithms » Implementation » Breaking the Records', () => { + it('should return the numbers representing the times most points records and least points records have been broken', () => { + expect(breakingRecords([10, 5, 20, 20, 4, 5, 2, 25, 1])).toEqual([ + 2, 4, + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Cats and a Mouse/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Cats and a Mouse/index.test.ts index 5d13349..ea37855 100644 --- a/src/Problem Solving/Algorithms/Implementation/Cats and a Mouse/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Cats and a Mouse/index.test.ts @@ -1,5 +1,7 @@ import { catAndMouse } from '@ProblemSolving/Algorithms/Implementation'; -test('should return Either "Cat A", "Cat B", or "Mouse C"', () => { - expect(catAndMouse(1, 2, 3)).toBe('Cat B'); +describe('Problem Solving » Algorithms » Implementation » Cats and a Mouse', () => { + it('should return Either "Cat A", "Cat B", or "Mouse C"', () => { + expect(catAndMouse(1, 2, 3)).toBe('Cat B'); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Cavity Map/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Cavity Map/index.test.ts index 3d5da54..6863446 100644 --- a/src/Problem Solving/Algorithms/Implementation/Cavity Map/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Cavity Map/index.test.ts @@ -1,10 +1,12 @@ import { cavityMap } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of chocolates Bobby can eat', () => { - expect(cavityMap(['1112', '1912', '1892', '1234'])).toEqual([ - '1112', - '1X12', - '18X2', - '1234', - ]); +describe('Problem Solving » Algorithms » Implementation » Cavity Map', () => { + it('should return the modified grid', () => { + expect(cavityMap(['1112', '1912', '1892', '1234'])).toEqual([ + '1112', + '1X12', + '18X2', + '1234', + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Chocolate Feast/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Chocolate Feast/index.test.ts index 25b7509..4e6f327 100644 --- a/src/Problem Solving/Algorithms/Implementation/Chocolate Feast/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Chocolate Feast/index.test.ts @@ -1,5 +1,7 @@ import { chocolateFeast } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of chocolates Bobby can eat', () => { - expect(chocolateFeast(10, 2, 5)).toBe(6); +describe('Problem Solving » Algorithms » Implementation » Chocolate Feast', () => { + it('should return the number of chocolates Bobby can eat', () => { + expect(chocolateFeast(10, 2, 5)).toBe(6); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Circular Array Rotation/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Circular Array Rotation/index.test.ts index 72048d6..a0e9544 100644 --- a/src/Problem Solving/Algorithms/Implementation/Circular Array Rotation/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Circular Array Rotation/index.test.ts @@ -1,5 +1,9 @@ import { circularArrayRotation } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the values in the rotated array', () => { - expect(circularArrayRotation([1, 2, 3], 2, [0, 1, 2])).toEqual([2, 3, 1]); +describe('Problem Solving » Algorithms » Implementation » Circular Array Rotation', () => { + it('should return the values in the rotated array', () => { + expect(circularArrayRotation([1, 2, 3], 2, [0, 1, 2])).toEqual([ + 2, 3, 1, + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Counting Valleys/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Counting Valleys/index.test.ts index 694a94b..8e900ea 100644 --- a/src/Problem Solving/Algorithms/Implementation/Counting Valleys/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Counting Valleys/index.test.ts @@ -1,5 +1,7 @@ import { countingValleys } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of valleys traversed', () => { - expect(countingValleys(8, 'UDDDUDUU')).toBe(1); +describe('Problem Solving » Algorithms » Implementation » Counting Valleys', () => { + it('should return the number of valleys traversed', () => { + expect(countingValleys(8, 'UDDDUDUU')).toBe(1); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Cut the sticks/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Cut the sticks/index.test.ts index 933a514..6da7777 100644 --- a/src/Problem Solving/Algorithms/Implementation/Cut the sticks/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Cut the sticks/index.test.ts @@ -1,5 +1,7 @@ import { cutTheSticks } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of sticks that are left before each iteration', () => { - expect(cutTheSticks([5, 4, 4, 2, 2, 8])).toEqual([6, 4, 2, 1]); +describe('Problem Solving » Algorithms » Implementation » Cut the sticks', () => { + it('should return the number of sticks that are left before each iteration', () => { + expect(cutTheSticks([5, 4, 4, 2, 2, 8])).toEqual([6, 4, 2, 1]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Day of the Programmer/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Day of the Programmer/index.test.ts index fed1e12..ba6ec82 100644 --- a/src/Problem Solving/Algorithms/Implementation/Day of the Programmer/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Day of the Programmer/index.test.ts @@ -1,5 +1,7 @@ import { dayOfProgrammer } from '@ProblemSolving/Algorithms/Implementation'; -test('should return date of the programmer day in the form [dd.mm.yyyy]', () => { - expect(dayOfProgrammer(2017)).toBe('13.09.2017'); +describe('Problem Solving » Algorithms » Implementation » Day of the Programmer', () => { + it('should return date of the programmer day in the form [dd.mm.yyyy]', () => { + expect(dayOfProgrammer(2017)).toBe('13.09.2017'); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Designer PDF Viewer/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Designer PDF Viewer/index.test.ts index a153d55..24d6141 100644 --- a/src/Problem Solving/Algorithms/Implementation/Designer PDF Viewer/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Designer PDF Viewer/index.test.ts @@ -1,13 +1,15 @@ import { designerPdfViewer } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the size of the highlighted area', () => { - expect( - designerPdfViewer( - [ - 1, 3, 1, 3, 1, 4, 1, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, - ], - 'abc' - ) - ).toBe(9); +describe('Problem Solving » Algorithms » Implementation » Designer PDF Viewer', () => { + it('should return the size of the highlighted area', () => { + expect( + designerPdfViewer( + [ + 1, 3, 1, 3, 1, 4, 1, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, + ], + 'abc' + ) + ).toBe(9); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Divisible Sum Pairs/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Divisible Sum Pairs/index.test.ts index d534e8e..22f3d16 100644 --- a/src/Problem Solving/Algorithms/Implementation/Divisible Sum Pairs/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Divisible Sum Pairs/index.test.ts @@ -1,5 +1,7 @@ import { divisibleSumPairs } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of pairs', () => { - expect(divisibleSumPairs(6, 3, [1, 3, 2, 6, 1, 2])).toBe(5); +describe('Problem Solving » Algorithms » Implementation » Divisible Sum Pairs', () => { + it('should return the number of pairs', () => { + expect(divisibleSumPairs(6, 3, [1, 3, 2, 6, 1, 2])).toBe(5); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Drawing Book/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Drawing Book/index.test.ts index d7b3c35..58d26a1 100644 --- a/src/Problem Solving/Algorithms/Implementation/Drawing Book/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Drawing Book/index.test.ts @@ -1,5 +1,7 @@ import { pageCount } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of pages to turn', () => { - expect(pageCount(6, 2)).toBe(1); +describe('Problem Solving » Algorithms » Implementation » Drawing Book', () => { + it('should return the number of pages to turn', () => { + expect(pageCount(6, 2)).toBe(1); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Electronics Shop/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Electronics Shop/index.test.ts index 1626819..c19424f 100644 --- a/src/Problem Solving/Algorithms/Implementation/Electronics Shop/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Electronics Shop/index.test.ts @@ -1,5 +1,7 @@ import { getMoneySpent } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the maximum that can be spent', () => { - expect(getMoneySpent([3, 1], [5, 2, 8], 10)).toBe(9); +describe('Problem Solving » Algorithms » Implementation » Electronics Shop', () => { + it('should return the maximum that can be spent', () => { + expect(getMoneySpent([3, 1], [5, 2, 8], 10)).toBe(9); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Fair Rations/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Fair Rations/index.test.ts index 0ec3aa5..8947e3f 100644 --- a/src/Problem Solving/Algorithms/Implementation/Fair Rations/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Fair Rations/index.test.ts @@ -1,5 +1,7 @@ import { fairRations } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the minimum number of loaves required', () => { - expect(fairRations([2, 3, 4, 5, 6])).toBe(4); +describe('Problem Solving » Algorithms » Implementation » Fair Rations', () => { + it('should return the minimum number of loaves required', () => { + expect(fairRations([2, 3, 4, 5, 6])).toBe(4); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Find Digits/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Find Digits/index.test.ts index 5e191ba..137d5a9 100644 --- a/src/Problem Solving/Algorithms/Implementation/Find Digits/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Find Digits/index.test.ts @@ -1,5 +1,7 @@ import { findDigits } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of divisors', () => { - expect(findDigits(1012)).toBe(3); +describe('Problem Solving » Algorithms » Implementation » Find Digits', () => { + it('should return the number of divisors', () => { + expect(findDigits(1012)).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Flatland Space Stations/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Flatland Space Stations/index.test.ts index 95953d8..b88f8bd 100644 --- a/src/Problem Solving/Algorithms/Implementation/Flatland Space Stations/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Flatland Space Stations/index.test.ts @@ -1,5 +1,7 @@ import { flatlandSpaceStations } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the maximum distance', () => { - expect(flatlandSpaceStations(5, [0, 4])).toBe(2); +describe('Problem Solving » Algorithms » Implementation » Flatland Space Stations', () => { + it('should return the maximum distance', () => { + expect(flatlandSpaceStations(5, [0, 4])).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Grading Students/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Grading Students/index.test.ts index 2a5f767..d77fe29 100644 --- a/src/Problem Solving/Algorithms/Implementation/Grading Students/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Grading Students/index.test.ts @@ -1,5 +1,7 @@ import { gradingStudents } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the rounded grades of students', () => { - expect(gradingStudents([73, 67, 38, 33])).toEqual([75, 67, 40, 33]); +describe('Problem Solving » Algorithms » Implementation » Grading Students', () => { + it('should return the rounded grades of students', () => { + expect(gradingStudents([73, 67, 38, 33])).toEqual([75, 67, 40, 33]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Jumping on the Clouds (Revisited)/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Jumping on the Clouds (Revisited)/index.test.ts index 6bd8e5c..21ccb12 100644 --- a/src/Problem Solving/Algorithms/Implementation/Jumping on the Clouds (Revisited)/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Jumping on the Clouds (Revisited)/index.test.ts @@ -1,5 +1,7 @@ import { jumpingOnClouds } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the remaining energy level', () => { - expect(jumpingOnClouds([0, 0, 1, 0, 0, 1, 1, 0], 2)).toBe(92); +describe('Problem Solving » Algorithms » Implementation » Jumping on the Clouds (Revisited)', () => { + it('should return the remaining energy level', () => { + expect(jumpingOnClouds([0, 0, 1, 0, 0, 1, 1, 0], 2)).toBe(92); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Lisa's Workbook/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Lisa's Workbook/index.test.ts index 7f621ad..e6c9211 100644 --- a/src/Problem Solving/Algorithms/Implementation/Lisa's Workbook/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Lisa's Workbook/index.test.ts @@ -1,5 +1,7 @@ import { workbook } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of special problems in the workbook', () => { - expect(workbook(5, 3, [4, 2, 6, 1, 10])).toBe(4); +describe("Problem Solving » Algorithms » Implementation » Lisa's Workbook", () => { + it('should return the number of special problems in the workbook', () => { + expect(workbook(5, 3, [4, 2, 6, 1, 10])).toBe(4); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Manasa and Stones/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Manasa and Stones/index.test.ts index f9f9d02..a250541 100644 --- a/src/Problem Solving/Algorithms/Implementation/Manasa and Stones/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Manasa and Stones/index.test.ts @@ -1,5 +1,7 @@ import { stones } from '@ProblemSolving/Algorithms/Implementation'; -test('should return possible values of the last stone', () => { - expect(stones(3, 1, 2)).toEqual([2, 3, 4]); +describe('Problem Solving » Algorithms » Implementation » Manasa and Stones', () => { + it('should return possible values of the last stone', () => { + expect(stones(3, 1, 2)).toEqual([2, 3, 4]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Migratory Birds/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Migratory Birds/index.test.ts index 007877c..ee89639 100644 --- a/src/Problem Solving/Algorithms/Implementation/Migratory Birds/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Migratory Birds/index.test.ts @@ -1,5 +1,7 @@ import { migratoryBirds } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the id of the most frequently sighted bird type', () => { - expect(migratoryBirds([1, 4, 4, 4, 5, 3])).toBe(4); +describe('Problem Solving » Algorithms » Implementation » Migratory Birds', () => { + it('should return the id of the most frequently sighted bird type', () => { + expect(migratoryBirds([1, 4, 4, 4, 5, 3])).toBe(4); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Minimum Distances/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Minimum Distances/index.test.ts index 98dad3b..c78be2e 100644 --- a/src/Problem Solving/Algorithms/Implementation/Minimum Distances/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Minimum Distances/index.test.ts @@ -1,5 +1,7 @@ import { minimumDistances } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the minimum distance between any pair of equal elements in the array', () => { - expect(minimumDistances([7, 1, 3, 4, 1, 7])).toBe(3); +describe('Problem Solving » Algorithms » Implementation » Minimum Distances', () => { + it('should return the minimum distance between any pair of equal elements in the array', () => { + expect(minimumDistances([7, 1, 3, 4, 1, 7])).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Number Line Jumps/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Number Line Jumps/index.test.ts index 9c085e9..d120b45 100644 --- a/src/Problem Solving/Algorithms/Implementation/Number Line Jumps/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Number Line Jumps/index.test.ts @@ -1,5 +1,7 @@ import { kangaroo } from '@ProblemSolving/Algorithms/Implementation'; -test('should return whether both kangaroos can reach at the same location at the same time or not', () => { - expect(kangaroo(0, 3, 4, 2)).toBe('YES'); +describe('Problem Solving » Algorithms » Implementation » Number Line Jumps', () => { + it('should return whether both kangaroos can reach at the same location at the same time or not', () => { + expect(kangaroo(0, 3, 4, 2)).toBe('YES'); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Picking Numbers/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Picking Numbers/index.test.ts index 6037ec4..556e5a7 100644 --- a/src/Problem Solving/Algorithms/Implementation/Picking Numbers/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Picking Numbers/index.test.ts @@ -1,5 +1,7 @@ import { pickingNumbers } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the length of the longest subarray', () => { - expect(pickingNumbers([4, 6, 5, 3, 3, 1])).toBe(3); +describe('Problem Solving » Algorithms » Implementation » Picking Numbers', () => { + it('should return the length of the longest subarray', () => { + expect(pickingNumbers([4, 6, 5, 3, 3, 1])).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Sales by Match/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Sales by Match/index.test.ts index 4bcfe55..908e494 100644 --- a/src/Problem Solving/Algorithms/Implementation/Sales by Match/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Sales by Match/index.test.ts @@ -1,5 +1,7 @@ import { sockMerchant } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of pairs', () => { - expect(sockMerchant(9, [10, 20, 20, 10, 10, 30, 50, 10, 20])).toBe(3); +describe('Problem Solving » Algorithms » Implementation » Sales by Match', () => { + it('should return the number of pairs', () => { + expect(sockMerchant(9, [10, 20, 20, 10, 10, 30, 50, 10, 20])).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Save the Prisoner/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Save the Prisoner/index.test.ts index 29dfe1c..6f3ea34 100644 --- a/src/Problem Solving/Algorithms/Implementation/Save the Prisoner/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Save the Prisoner/index.test.ts @@ -1,5 +1,7 @@ import { saveThePrisoner } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the chair number of the prisoner to warn', () => { - expect(saveThePrisoner(5, 2, 1)).toBe(2); +describe('Problem Solving » Algorithms » Implementation » Save the Prisoner', () => { + it('should return the chair number of the prisoner to warn', () => { + expect(saveThePrisoner(5, 2, 1)).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Sequence Equation/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Sequence Equation/index.test.ts index 8b624b7..af1c284 100644 --- a/src/Problem Solving/Algorithms/Implementation/Sequence Equation/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Sequence Equation/index.test.ts @@ -1,5 +1,7 @@ import { permutationEquation } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the permuted array', () => { - expect(permutationEquation([2, 3, 1])).toEqual([2, 3, 1]); +describe('Problem Solving » Algorithms » Implementation » Sequence Equation', () => { + it('should return the permuted array', () => { + expect(permutationEquation([2, 3, 1])).toEqual([2, 3, 1]); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Sherlock and Squares/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Sherlock and Squares/index.test.ts index d81336b..be06e10 100644 --- a/src/Problem Solving/Algorithms/Implementation/Sherlock and Squares/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Sherlock and Squares/index.test.ts @@ -1,5 +1,7 @@ import { squares } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of square integers in the range', () => { - expect(squares(3, 9)).toBe(2); +describe('Problem Solving » Algorithms » Implementation » Sherlock and Squares', () => { + it('should return the number of square integers in the range', () => { + expect(squares(3, 9)).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Subarray Division/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Subarray Division/index.test.ts index d247dce..bc3ecf6 100644 --- a/src/Problem Solving/Algorithms/Implementation/Subarray Division/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Subarray Division/index.test.ts @@ -1,5 +1,7 @@ import { birthday } from '@ProblemSolving/Algorithms/Implementation'; -test('should return the number of ways the chocolate bar can be divided', () => { - expect(birthday([1, 2, 1, 3, 2], 3, 2)).toBe(2); +describe('Problem Solving » Algorithms » Implementation » Subarray Division', () => { + it('should return the number of ways the chocolate bar can be divided', () => { + expect(birthday([1, 2, 1, 3, 2], 3, 2)).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/The Hurdle Race/index.test.ts b/src/Problem Solving/Algorithms/Implementation/The Hurdle Race/index.test.ts index 06471fa..4dbc0cc 100644 --- a/src/Problem Solving/Algorithms/Implementation/The Hurdle Race/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/The Hurdle Race/index.test.ts @@ -1,5 +1,7 @@ import { theHurdleRace } from '@ProblemSolving/Algorithms/Implementation'; -test('should return how many doses are required', () => { - expect(theHurdleRace(4, [1, 6, 3, 5, 2])).toBe(2); +describe('Problem Solving » Algorithms » Implementation » The Hurdle Race', () => { + it('should return how many doses are required', () => { + expect(theHurdleRace(4, [1, 6, 3, 5, 2])).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Utopian Tree/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Utopian Tree/index.test.ts index 491a1f0..7461c45 100644 --- a/src/Problem Solving/Algorithms/Implementation/Utopian Tree/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Utopian Tree/index.test.ts @@ -1,5 +1,7 @@ import { utopianTree } from '@ProblemSolving/Algorithms/Implementation'; -test('should return how tall will the tree be', () => { - expect(utopianTree(4)).toBe(7); +describe('Problem Solving » Algorithms » Implementation » Utopian Tree', () => { + it('should return how tall will the tree be', () => { + expect(utopianTree(4)).toBe(7); + }); }); diff --git a/src/Problem Solving/Algorithms/Implementation/Viral Advertising/index.test.ts b/src/Problem Solving/Algorithms/Implementation/Viral Advertising/index.test.ts index 2c8ac1d..7b47876 100644 --- a/src/Problem Solving/Algorithms/Implementation/Viral Advertising/index.test.ts +++ b/src/Problem Solving/Algorithms/Implementation/Viral Advertising/index.test.ts @@ -1,5 +1,7 @@ import { viralAdvertising } from '@ProblemSolving/Algorithms/Implementation'; -test('should return how many people have liked the ad', () => { - expect(viralAdvertising(3)).toBe(9); +describe('Problem Solving » Algorithms » Implementation » Viral Advertising', () => { + it('should return how many people have liked the ad', () => { + expect(viralAdvertising(3)).toBe(9); + }); }); diff --git a/src/Problem Solving/Algorithms/Sorting/Counting Sort 1/index.test.ts b/src/Problem Solving/Algorithms/Sorting/Counting Sort 1/index.test.ts index ab093c8..03e72ac 100644 --- a/src/Problem Solving/Algorithms/Sorting/Counting Sort 1/index.test.ts +++ b/src/Problem Solving/Algorithms/Sorting/Counting Sort 1/index.test.ts @@ -1,20 +1,23 @@ import { countingSort1 } from '@ProblemSolving/Algorithms/Sorting'; -test('should return the frequency array', () => { - expect( - countingSort1([ - 63, 25, 73, 1, 98, 73, 56, 84, 86, 57, 16, 83, 8, 25, 81, 56, 9, 53, - 98, 67, 99, 12, 83, 89, 80, 91, 39, 86, 76, 85, 74, 39, 25, 90, 59, - 10, 94, 32, 44, 3, 89, 30, 27, 79, 46, 96, 27, 32, 18, 21, 92, 69, - 81, 40, 40, 34, 68, 78, 24, 87, 42, 69, 23, 41, 78, 22, 6, 90, 99, - 89, 50, 30, 20, 1, 43, 3, 70, 95, 33, 46, 44, 9, 69, 48, 33, 60, 65, - 16, 82, 67, 61, 32, 21, 79, 75, 75, 13, 87, 70, 33, - ]) - ).toEqual([ - 0, 2, 0, 2, 0, 0, 1, 0, 1, 2, 1, 0, 1, 1, 0, 0, 2, 0, 1, 0, 1, 2, 1, 1, - 1, 3, 0, 2, 0, 0, 2, 0, 3, 3, 1, 0, 0, 0, 0, 2, 2, 1, 1, 1, 2, 0, 2, 0, - 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 2, 1, 3, 2, 0, - 0, 2, 1, 2, 1, 0, 2, 2, 1, 2, 1, 2, 1, 1, 2, 2, 0, 3, 2, 1, 1, 0, 1, 1, - 1, 0, 2, 2, - ]); +describe('Problem Solving » Algorithms » Sorting » Counting Sort 1', () => { + it('should return the frequency array', () => { + expect( + countingSort1([ + 63, 25, 73, 1, 98, 73, 56, 84, 86, 57, 16, 83, 8, 25, 81, 56, 9, + 53, 98, 67, 99, 12, 83, 89, 80, 91, 39, 86, 76, 85, 74, 39, 25, + 90, 59, 10, 94, 32, 44, 3, 89, 30, 27, 79, 46, 96, 27, 32, 18, + 21, 92, 69, 81, 40, 40, 34, 68, 78, 24, 87, 42, 69, 23, 41, 78, + 22, 6, 90, 99, 89, 50, 30, 20, 1, 43, 3, 70, 95, 33, 46, 44, 9, + 69, 48, 33, 60, 65, 16, 82, 67, 61, 32, 21, 79, 75, 75, 13, 87, + 70, 33, + ]) + ).toEqual([ + 0, 2, 0, 2, 0, 0, 1, 0, 1, 2, 1, 0, 1, 1, 0, 0, 2, 0, 1, 0, 1, 2, 1, + 1, 1, 3, 0, 2, 0, 0, 2, 0, 3, 3, 1, 0, 0, 0, 0, 2, 2, 1, 1, 1, 2, 0, + 2, 0, 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 2, 1, + 3, 2, 0, 0, 2, 1, 2, 1, 0, 2, 2, 1, 2, 1, 2, 1, 1, 2, 2, 0, 3, 2, 1, + 1, 0, 1, 1, 1, 0, 2, 2, + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Sorting/Counting Sort 2/index.test.ts b/src/Problem Solving/Algorithms/Sorting/Counting Sort 2/index.test.ts index 3e012b8..24fe778 100644 --- a/src/Problem Solving/Algorithms/Sorting/Counting Sort 2/index.test.ts +++ b/src/Problem Solving/Algorithms/Sorting/Counting Sort 2/index.test.ts @@ -1,21 +1,24 @@ import { countingSort2 } from '@ProblemSolving/Algorithms/Sorting'; -test('should return the sorted array', () => { - expect( - countingSort2([ - 63, 25, 73, 1, 98, 73, 56, 84, 86, 57, 16, 83, 8, 25, 81, 56, 9, 53, - 98, 67, 99, 12, 83, 89, 80, 91, 39, 86, 76, 85, 74, 39, 25, 90, 59, - 10, 94, 32, 44, 3, 89, 30, 27, 79, 46, 96, 27, 32, 18, 21, 92, 69, - 81, 40, 40, 34, 68, 78, 24, 87, 42, 69, 23, 41, 78, 22, 6, 90, 99, - 89, 50, 30, 20, 1, 43, 3, 70, 95, 33, 46, 44, 9, 69, 48, 33, 60, 65, - 16, 82, 67, 61, 32, 21, 79, 75, 75, 13, 87, 70, 33, - ]) - ).toEqual([ - 1, 1, 3, 3, 6, 8, 9, 9, 10, 12, 13, 16, 16, 18, 20, 21, 21, 22, 23, 24, - 25, 25, 25, 27, 27, 30, 30, 32, 32, 32, 33, 33, 33, 34, 39, 39, 40, 40, - 41, 42, 43, 44, 44, 46, 46, 48, 50, 53, 56, 56, 57, 59, 60, 61, 63, 65, - 67, 67, 68, 69, 69, 69, 70, 70, 73, 73, 74, 75, 75, 76, 78, 78, 79, 79, - 80, 81, 81, 82, 83, 83, 84, 85, 86, 86, 87, 87, 89, 89, 89, 90, 90, 91, - 92, 94, 95, 96, 98, 98, 99, 99, - ]); +describe('Problem Solving » Algorithms » Sorting » Counting Sort 2', () => { + it('should return the sorted array', () => { + expect( + countingSort2([ + 63, 25, 73, 1, 98, 73, 56, 84, 86, 57, 16, 83, 8, 25, 81, 56, 9, + 53, 98, 67, 99, 12, 83, 89, 80, 91, 39, 86, 76, 85, 74, 39, 25, + 90, 59, 10, 94, 32, 44, 3, 89, 30, 27, 79, 46, 96, 27, 32, 18, + 21, 92, 69, 81, 40, 40, 34, 68, 78, 24, 87, 42, 69, 23, 41, 78, + 22, 6, 90, 99, 89, 50, 30, 20, 1, 43, 3, 70, 95, 33, 46, 44, 9, + 69, 48, 33, 60, 65, 16, 82, 67, 61, 32, 21, 79, 75, 75, 13, 87, + 70, 33, + ]) + ).toEqual([ + 1, 1, 3, 3, 6, 8, 9, 9, 10, 12, 13, 16, 16, 18, 20, 21, 21, 22, 23, + 24, 25, 25, 25, 27, 27, 30, 30, 32, 32, 32, 33, 33, 33, 34, 39, 39, + 40, 40, 41, 42, 43, 44, 44, 46, 46, 48, 50, 53, 56, 56, 57, 59, 60, + 61, 63, 65, 67, 67, 68, 69, 69, 69, 70, 70, 73, 73, 74, 75, 75, 76, + 78, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 85, 86, 86, 87, 87, 89, + 89, 89, 90, 90, 91, 92, 94, 95, 96, 98, 98, 99, 99, + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Sorting/Find the Median/index.test.ts b/src/Problem Solving/Algorithms/Sorting/Find the Median/index.test.ts index 7eefd0e..aeb9399 100644 --- a/src/Problem Solving/Algorithms/Sorting/Find the Median/index.test.ts +++ b/src/Problem Solving/Algorithms/Sorting/Find the Median/index.test.ts @@ -1,5 +1,7 @@ import { findMedian } from '@ProblemSolving/Algorithms/Sorting'; -test('should return the median of the array', () => { - expect(findMedian([0, 1, 2, 4, 6, 5, 3])).toBe(3); +describe('Problem Solving » Algorithms » Sorting » Find the Median', () => { + it('should return the median of the array', () => { + expect(findMedian([0, 1, 2, 4, 6, 5, 3])).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Strings/CamelCase/index.test.ts b/src/Problem Solving/Algorithms/Strings/CamelCase/index.test.ts index 7fc330d..bf44076 100644 --- a/src/Problem Solving/Algorithms/Strings/CamelCase/index.test.ts +++ b/src/Problem Solving/Algorithms/Strings/CamelCase/index.test.ts @@ -1,5 +1,7 @@ import { camelcase } from '@ProblemSolving/Algorithms/Strings'; -test('should return the number of words', () => { - expect(camelcase('saveChangesInTheEditor')).toBe(5); +describe('Problem Solving » Algorithms » Strings » CamelCase', () => { + it('should return the number of words', () => { + expect(camelcase('saveChangesInTheEditor')).toBe(5); + }); }); diff --git a/src/Problem Solving/Algorithms/Strings/HackerRank in a String!/index.test.ts b/src/Problem Solving/Algorithms/Strings/HackerRank in a String!/index.test.ts index 6757c8d..e122fb9 100644 --- a/src/Problem Solving/Algorithms/Strings/HackerRank in a String!/index.test.ts +++ b/src/Problem Solving/Algorithms/Strings/HackerRank in a String!/index.test.ts @@ -1,5 +1,7 @@ import { hackerrankInString } from '@ProblemSolving/Algorithms/Strings'; -test("should return whether 'YES' | 'NO'", () => { - expect(hackerrankInString('hereiamstackerrank')).toBe('YES'); +describe('Problem Solving » Algorithms » Strings » HackerRank in a String!', () => { + it("should return whether 'YES' | 'NO'", () => { + expect(hackerrankInString('hereiamstackerrank')).toBe('YES'); + }); }); diff --git a/src/Problem Solving/Algorithms/Strings/Mars Exploration/index.test.ts b/src/Problem Solving/Algorithms/Strings/Mars Exploration/index.test.ts index 0fdd905..a998b92 100644 --- a/src/Problem Solving/Algorithms/Strings/Mars Exploration/index.test.ts +++ b/src/Problem Solving/Algorithms/Strings/Mars Exploration/index.test.ts @@ -1,5 +1,7 @@ import { marsExploration } from '@ProblemSolving/Algorithms/Strings'; -test('should return the number of changed letters', () => { - expect(marsExploration('SOSSPSSQSSOR')).toBe(3); +describe('Problem Solving » Algorithms » Strings » Mars Exploration', () => { + it('should return the number of changed letters', () => { + expect(marsExploration('SOSSPSSQSSOR')).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Strings/Strong Password/index.test.ts b/src/Problem Solving/Algorithms/Strings/Strong Password/index.test.ts index 4ddb61c..b20623f 100644 --- a/src/Problem Solving/Algorithms/Strings/Strong Password/index.test.ts +++ b/src/Problem Solving/Algorithms/Strings/Strong Password/index.test.ts @@ -1,5 +1,7 @@ import { minimumNumber } from '@ProblemSolving/Algorithms/Strings'; -test('should return the number of characters needed to be a strong password', () => { - expect(minimumNumber(3, 'Ab1')).toBe(3); +describe('Problem Solving » Algorithms » Strings » Strong Password', () => { + it('should return the number of characters needed to be a strong password', () => { + expect(minimumNumber(3, 'Ab1')).toBe(3); + }); }); diff --git a/src/Problem Solving/Algorithms/Strings/Super Reduced String/index.test.ts b/src/Problem Solving/Algorithms/Strings/Super Reduced String/index.test.ts index 5f95c2f..d6afab1 100644 --- a/src/Problem Solving/Algorithms/Strings/Super Reduced String/index.test.ts +++ b/src/Problem Solving/Algorithms/Strings/Super Reduced String/index.test.ts @@ -1,5 +1,7 @@ import { superReducedString } from '@ProblemSolving/Algorithms/Strings'; -test('should return the reduced string', () => { - expect(superReducedString('aaabccddd')).toBe('abd'); +describe('Problem Solving » Algorithms » Strings » Super Reduced String', () => { + it('should return the reduced string', () => { + expect(superReducedString('aaabccddd')).toBe('abd'); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/A Very Big Sum/index.test.ts b/src/Problem Solving/Algorithms/Warmup/A Very Big Sum/index.test.ts index 0d338a2..684916a 100644 --- a/src/Problem Solving/Algorithms/Warmup/A Very Big Sum/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/A Very Big Sum/index.test.ts @@ -1,9 +1,11 @@ import { aVeryBigSum } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the sum of the big numbers array', () => { - expect( - aVeryBigSum([ - 1000000001, 1000000002, 1000000003, 1000000004, 1000000005, - ]) - ).toBe(5000000015); +describe('Problem Solving » Algorithms » Warmup » A Very Big Sum', () => { + it('should return the sum of the big numbers array', () => { + expect( + aVeryBigSum([ + 1000000001, 1000000002, 1000000003, 1000000004, 1000000005, + ]) + ).toBe(5000000015); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Birthday Cake Candles/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Birthday Cake Candles/index.test.ts index b9d8eb2..0f39fd9 100644 --- a/src/Problem Solving/Algorithms/Warmup/Birthday Cake Candles/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Birthday Cake Candles/index.test.ts @@ -1,5 +1,7 @@ import { birthdayCakeCandles } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the number of tallest candles in the array', () => { - expect(birthdayCakeCandles([3, 2, 1, 3])).toBe(2); +describe('Problem Solving » Algorithms » Warmup » Birthday Cake Candles', () => { + it('should return the number of tallest candles in the array', () => { + expect(birthdayCakeCandles([3, 2, 1, 3])).toBe(2); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Compare the Triplets/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Compare the Triplets/index.test.ts index 297b236..12f52b2 100644 --- a/src/Problem Solving/Algorithms/Warmup/Compare the Triplets/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Compare the Triplets/index.test.ts @@ -1,5 +1,7 @@ import { compareTriplets } from '@ProblemSolving/Algorithms/Warmup'; -test('should compare two triplets and return a tuple of two numbers', () => { - expect(compareTriplets([5, 6, 7], [3, 6, 10])).toEqual([1, 1]); +describe('Problem Solving » Algorithms » Warmup » Compare the Triplets', () => { + it('should compare two triplets and return a tuple of two numbers', () => { + expect(compareTriplets([5, 6, 7], [3, 6, 10])).toEqual([1, 1]); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Diagonal Difference/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Diagonal Difference/index.test.ts index 4fd50a4..8fbed6b 100644 --- a/src/Problem Solving/Algorithms/Warmup/Diagonal Difference/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Diagonal Difference/index.test.ts @@ -1,11 +1,13 @@ import { diagonalDifference } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the absolute diagonal difference of 2d array', () => { - expect( - diagonalDifference([ - [11, 2, 4], - [4, 5, 6], - [10, 8, -12], - ]) - ).toBe(15); +describe('Problem Solving » Algorithms » Warmup » Diagonal Difference', () => { + it('should return the absolute diagonal difference of 2d array', () => { + expect( + diagonalDifference([ + [11, 2, 4], + [4, 5, 6], + [10, 8, -12], + ]) + ).toBe(15); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Mini-Max Sum/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Mini-Max Sum/index.test.ts index f04f687..4a3c261 100644 --- a/src/Problem Solving/Algorithms/Warmup/Mini-Max Sum/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Mini-Max Sum/index.test.ts @@ -1,5 +1,7 @@ import { miniMaxSum } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the min-max sum of the array', () => { - expect(miniMaxSum([1, 2, 3, 4, 5])).toEqual([10, 14]); +describe('Problem Solving » Algorithms » Warmup » Mini-Max Sum', () => { + it('should return the min-max sum of the array', () => { + expect(miniMaxSum([1, 2, 3, 4, 5])).toEqual([10, 14]); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Plus Minus/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Plus Minus/index.test.ts index 86e55d0..5226bd8 100644 --- a/src/Problem Solving/Algorithms/Warmup/Plus Minus/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Plus Minus/index.test.ts @@ -1,9 +1,11 @@ import { plusMinus } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the ratios of positive, negative and zero values in the array', () => { - expect(plusMinus([-4, 3, -9, 0, 4, 1])).toEqual([ - '0.500000', - '0.333333', - '0.166667', - ]); +describe('Problem Solving » Algorithms » Warmup » Plus Minus', () => { + it('should return the ratios of positive, negative and zero values in the array', () => { + expect(plusMinus([-4, 3, -9, 0, 4, 1])).toEqual([ + '0.500000', + '0.333333', + '0.166667', + ]); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Simple Array Sum/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Simple Array Sum/index.test.ts index 203a197..88db6f5 100644 --- a/src/Problem Solving/Algorithms/Warmup/Simple Array Sum/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Simple Array Sum/index.test.ts @@ -1,5 +1,7 @@ import { simpleArraySum } from '@ProblemSolving/Algorithms/Warmup'; -test('should return the sum of the array', () => { - expect(simpleArraySum([1, 2, 3, 4, 10, 11])).toBe(31); +describe('Problem Solving » Algorithms » Warmup » Simple Array Sum', () => { + it('should return the sum of the array', () => { + expect(simpleArraySum([1, 2, 3, 4, 10, 11])).toBe(31); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Solve Me First/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Solve Me First/index.test.ts index ee0f013..fd2f490 100644 --- a/src/Problem Solving/Algorithms/Warmup/Solve Me First/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Solve Me First/index.test.ts @@ -1,5 +1,7 @@ import { solveMeFirst } from '@ProblemSolving/Algorithms/Warmup'; -test('should add two numbers', () => { - expect(solveMeFirst(2, 3)).toBe(5); +describe('Problem Solving » Algorithms » Warmup » Solve Me First', () => { + it('should add two numbers', () => { + expect(solveMeFirst(2, 3)).toBe(5); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Staircase/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Staircase/index.test.ts index b4e3db3..d46ca92 100644 --- a/src/Problem Solving/Algorithms/Warmup/Staircase/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Staircase/index.test.ts @@ -1,7 +1,9 @@ import { staircase } from '@ProblemSolving/Algorithms/Warmup'; -test('should return a staircase as string', () => { - expect(staircase(6)).toMatch( - ' #\n ##\n ###\n ####\n #####\n######\n' - ); +describe('Problem Solving » Algorithms » Warmup » Staircase', () => { + it('should return a staircase as string', () => { + expect(staircase(6)).toMatch( + ' #\n ##\n ###\n ####\n #####\n######\n' + ); + }); }); diff --git a/src/Problem Solving/Algorithms/Warmup/Time Conversion/index.test.ts b/src/Problem Solving/Algorithms/Warmup/Time Conversion/index.test.ts index edb2ea7..2ed284f 100644 --- a/src/Problem Solving/Algorithms/Warmup/Time Conversion/index.test.ts +++ b/src/Problem Solving/Algorithms/Warmup/Time Conversion/index.test.ts @@ -1,5 +1,7 @@ import { timeConversion } from '@ProblemSolving/Algorithms/Warmup'; -test('should convert 12-hour time to 24-hour time', () => { - expect(timeConversion('07:05:45PM')).toMatch('19:05:45'); +describe('Problem Solving » Algorithms » Warmup » Time Conversion', () => { + it('should convert 12-hour time to 24-hour time', () => { + expect(timeConversion('07:05:45PM')).toMatch('19:05:45'); + }); });