7 kyu
How many are smaller than me?
5,615 of 10,552joh_pot
Description:
Write a function that given, an array arr
, returns an array containing at each index i
the amount of numbers that are smaller than arr[i]
to the right.
For example:
* Input [5, 4, 3, 2, 1] => Output [4, 3, 2, 1, 0]
* Input [1, 2, 0] => Output [1, 1, 0]
If you've completed this one and you feel like testing your performance tuning of this same kata, head over to the much tougher version How many are smaller than me II?
Arrays
Algorithms
Similar Kata:
Stats:
Created | Jan 22, 2016 |
Published | Jan 22, 2016 |
Warriors Trained | 17468 |
Total Skips | 296 |
Total Code Submissions | 21148 |
Total Times Completed | 10552 |
JavaScript Completions | 5615 |
Python Completions | 4124 |
CoffeeScript Completions | 28 |
Haskell Completions | 154 |
Ruby Completions | 247 |
COBOL Completions | 12 |
Go Completions | 231 |
C Completions | 139 |
TypeScript Completions | 168 |
PHP Completions | 145 |
Prolog Completions | 6 |
Lua Completions | 16 |
Total Stars | 159 |
% of votes with a positive feedback rating | 92% of 1052 |
Total "Very Satisfied" Votes | 901 |
Total "Somewhat Satisfied" Votes | 132 |
Total "Not Satisfied" Votes | 19 |