40% votes, then 40% of that option row should be filled with color.
percentage = votesForOption * 100 / totalVotes. Return options in their original order.
Because floor division is used, returned percentages are not required to sum to exactly 100.
VotingSystem(List<String> options)
0 votes.List<String> vote(int optionIndex)
optionIndex."optionText,votes,percentage".percentage value is also the color fill percentage for that option.List<String> getResults()
"optionText,votes,percentage".0%.options.size() = 41 ≤ options.get(i).length() ≤ 1000 ≤ optionIndex < 40 ≤ total number of method calls ≤ 100,000VotingSystem(options = ["Java", "Python", "C++", "JavaScript"]) getResults() Output: ["Java,0,0", "Python,0,0", "C++,0,0", "JavaScript,0,0"]
0 votes and 0% color fill.
VotingSystem(options = ["Red", "Blue", "Green", "Yellow"]) vote(optionIndex = 1) Output: ["Red,0,0", "Blue,1,100", "Green,0,0", "Yellow,0,0"]
"Blue". It has all votes, so its percentage and color fill become 100%.
VotingSystem(options = ["A", "B", "C", "D"]) vote(optionIndex = 0) Output: ["A,1,100", "B,0,0", "C,0,0", "D,0,0"] vote(optionIndex = 2) Output: ["A,1,50", "B,0,0", "C,1,50", "D,0,0"] vote(optionIndex = 2) Output: ["A,1,33", "B,0,0", "C,2,66", "D,0,0"]
"A" has 1 vote and option "C" has 2 votes. Percentages are calculated using floor division.