Question: Consider a JSON string that looks like this: [ Swiggy , 1 2 3 ] , [ Swiggy , 2 2
Consider a JSON string that looks like this:
Swiggy
Swiggy
Zomato
Zomato
Dunzo
Zomato
Swiggy This string encodes a list of payments made by a person for various delivery services. Each element of the list is a itself a list of two elements the first is the name of the service, and the second is the amount.
Write a functionmethod in JavaScript to take such a string and return the number of services for which this person has never paid an amount of or more.
For example, if the above string is passed to your code, it should return since this person has never paid or more for Zomato and Dunzo. Remember, the input will be passed to you as a string.
In the comments in your code, indicate what is the running time of your program eg On or O n logn You get bonus points if your program has a average running time of n logn or On
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
