Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Krafalski committed Oct 6, 2022
2 parents d515632 + f6a5ccf commit b759459
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data-structures-&-algorithms/codewars-problem-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ None, take time to solve any problems you got stuck on with a partner.

## Arrays & callbacks

- [Unit Tested Array Drills](https://github.com/joinpursuit/array-method-drills)

### Codewars

- [Gravity Flip](https://www.codewars.com/kata/5f70c883e10f9e0001c89673)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ const nums = [
const findTheMedian = (numArray) => {
numArray.sort();
if (numArray.length % 2 !== 0) {
return Math.round(numArray.length / 2);
return numArray[Math.round(numArray.length / 2)];
} else {
const firstNum = numArray[Math.round(numArray.length / 2) - 1];
const secondNum = numArray[Math.round(numArray.length / 2)];
Expand Down

0 comments on commit b759459

Please sign in to comment.