PYTHON
Problem Statement
Given a list of numbers (nums), for each element in nums, calculate how many numbers in the list are smaller than it. Write a function that does the calculation and returns the result (as a list). For example, if you are given [6,5,4,8], your function should return [2, 1, 0, 3] because there are two numbers less than 6, one number less than 5, zero numbers less than 4, and three numbers less than 8.
smaller_than_current([6,5,4,8])
[2, 1, 0, 3]
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here