This file contains hidden or 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
function distributeSeats(percentages, totalSeats, threshold) { | |
const validParties = percentages.filter((percentage) => percentage >= threshold); | |
const totalValidPercentages = validParties.reduce((a, b) => a + b, 0); | |
const seatDistribution = []; | |
validParties.forEach((percentage) => { | |
const seats = Math.floor((percentage / totalValidPercentages) * totalSeats); | |
seatDistribution.push(seats); | |
}); |
See how a minor change to your commit message style can make a difference.
git commit \ -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"