Skip to content

Commit

Permalink
172nd Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Jul 21, 2024
1 parent 6740357 commit 8c7da05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { numberOfEmployeesWhoMetTarget } from './numberOfEmployeesWhoMetTarget';

describe('2798. Number of Employees Who Met the Target', () => {
test('numberOfEmployeesWhoMetTarget', () => {
expect(numberOfEmployeesWhoMetTarget([0, 1, 2, 3, 4], 2)).toBe(3);
expect(numberOfEmployeesWhoMetTarget([5, 1, 4, 2, 2], 6)).toBe(0);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type numberOfEmployeesWhoMetTarget = (hours: number[], target: number) => number;

/**
* Accepted
*/
export const numberOfEmployeesWhoMetTarget: numberOfEmployeesWhoMetTarget = (hours, target) => {
return hours.filter((hour) => hour >= target).length;
};

0 comments on commit 8c7da05

Please sign in to comment.