7 kyu
Numbers with this digit inside
286 of 5,551user5036852
Description:
You have to search all numbers from inclusive 1 to inclusive a given number x, that have the given digit d in it.
The value of d will always be 0 - 9.
The value of x will always be greater than 0.
You have to return as an array
- the count of these numbers,
- their sum
- and their product.
For example:
x = 11
d = 1
->
Numbers: 1, 10, 11
Return: [3, 22, 110]
If there are no numbers, which include the digit, return [0,0,0].
Have fun coding it and please don't forget to vote and rank this kata! :-)
I have created other katas. Have a look if you like coding and challenges.
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Aug 12, 2016 |
Published | Aug 12, 2016 |
Warriors Trained | 12969 |
Total Skips | 1461 |
Total Code Submissions | 25390 |
Total Times Completed | 5551 |
C# Completions | 286 |
JavaScript Completions | 1271 |
Java Completions | 575 |
C++ Completions | 814 |
Python Completions | 1378 |
Ruby Completions | 248 |
PHP Completions | 431 |
F# Completions | 53 |
TypeScript Completions | 184 |
Haskell Completions | 106 |
CoffeeScript Completions | 12 |
Swift Completions | 466 |
Total Stars | 131 |
% of votes with a positive feedback rating | 88% of 1002 |
Total "Very Satisfied" Votes | 791 |
Total "Somewhat Satisfied" Votes | 180 |
Total "Not Satisfied" Votes | 31 |