Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 650 Bytes

README.md

File metadata and controls

21 lines (12 loc) · 650 Bytes

Frog catching Insects Problem

Problem Statement

You are given:

A list of frogs' locations.
A corresponding list of tongue sizes for each frog.
A list of insect locations.

The $i^{th}$ frog catches the $j^{th}$ insect if (insectj - frogi) <= tonguei

Find the output a list of integers where the $i^{th}$ element represents the number of insects caught by the $i^{th}$ frog.

Constraints

Each frog's tongue size is a positive integer (0 < N < 105).

All locations (frogs and insects) are integers.

Insects may fall into the catch range of multiple frogs.