-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcde19d
commit d82d476
Showing
5 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/page-4/345. Reverse Vowels of a String/reverseVowels.bench.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { bench } from 'vitest'; | ||
|
||
import { reverseVowels, reverseVowels2 } from './reverseVowels'; | ||
|
||
describe('345. Reverse Vowels of a String', () => { | ||
// fastest | ||
bench('reverseVowels', () => { | ||
reverseVowels('hello'); | ||
reverseVowels('leetcode'); | ||
}); | ||
|
||
bench('reverseVowels2', () => { | ||
reverseVowels2('hello'); | ||
reverseVowels2('leetcode'); | ||
}); | ||
}); |
8 changes: 0 additions & 8 deletions
8
src/page-4/345. Reverse Vowels of a String/reverseVowels.spec.ts
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/page-4/345. Reverse Vowels of a String/reverseVowels.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { reverseVowels, reverseVowels2 } from './reverseVowels'; | ||
|
||
describe('345. Reverse Vowels of a String', () => { | ||
test('reverseVowels', () => { | ||
expect(reverseVowels('hello')).toBe('holle'); | ||
expect(reverseVowels('leetcode')).toBe('leotcede'); | ||
}); | ||
|
||
test('reverseVowels2', () => { | ||
expect(reverseVowels2('hello')).toBe('holle'); | ||
expect(reverseVowels2('leetcode')).toBe('leotcede'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters