Commit e8008a5f authored by nanahira's avatar nanahira

fix

parent 87cff533
......@@ -147,7 +147,7 @@ function getMedianCode(cards: Card[]) {
if (len % 2 === 0) {
return Math.floor((sortedCards[len / 2 - 1].id + sortedCards[len / 2].id) / 2);
} else {
const targetSequence = (len + 1) / 2;
const targetSequence = (len + 1) / 2 - 1;
return Math.floor((sortedCards[targetSequence - 1].id + sortedCards[targetSequence].id) / 2);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment