Solving JS Algorithm Problem: How Many Numbers Are Smaller Than the Current Number

nums = [8,1,2,2,3]
For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3). 
For nums[1]=1 does not exist any smaller number than it.
For nums[2]=2 there exist one smaller number than it (1).
For nums[3]=2 there exist one smaller number than it (1).
For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).

--

--

--

Flatiron School Graduate with finance, budget, and tax experience.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Intercepting component state to ensure smooth animated transitions

Automating E2E tests on Gympass Mobile App

5 Awesome JavaScript Libraries Web Developers Love to Use

Understanding Promises in JavaScript

The 1–2–3’s of React Native Templates

How to add a texture to shader graph

Enabling SSR on an existing React + Laravel App

Package.JSON & Package-lock.JSON- Angular

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Perezchristian

Perezchristian

Flatiron School Graduate with finance, budget, and tax experience.

More from Medium

103. Binary Tree Zigzag Level Order Traversal 🚀

Intro to Linked Lists — Singly (JavaScript)

Redux can be your friend…

Algorithms: 2 pointers, two sum on sorted Array