5 kyu
Histogram - V1
194 of 995dinglemouse
Description:
Kata in this series
Background
A 6-sided die is rolled a number of times and the results are plotted as a character-based histogram.
Example:
10
#
#
7 #
# #
# # 5
# # #
# 3 # #
# # # #
# # # 1 #
# # # # #
-----------
1 2 3 4 5 6
Task
You will be passed all the dice roll results, and your task is to write the code to return a string representing a histogram, so that when it is printed it has the same format as the example.
Notes
- There are no trailing spaces on the lines
- All lines (including the last) end with a newline
\n
- A count is displayed above each bar (unless the count is 0)
- The number of rolls may vary but is always less than 100
Strings
Algorithms
Similar Kata:
Stats:
Created | Aug 31, 2016 |
Published | Sep 11, 2016 |
Warriors Trained | 3298 |
Total Skips | 691 |
Total Code Submissions | 9962 |
Total Times Completed | 995 |
Java Completions | 194 |
C# Completions | 136 |
C++ Completions | 244 |
JavaScript Completions | 236 |
Python Completions | 204 |
Go Completions | 11 |
Total Stars | 109 |
% of votes with a positive feedback rating | 89% of 253 |
Total "Very Satisfied" Votes | 203 |
Total "Somewhat Satisfied" Votes | 42 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 10 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |