Description
Solutions
Maximum Fish Caught
👩‍🎓 NEW GRAD

NOTE 📝 - See the Problem Source section below for the original problem prompt 🐝🐝

Many years agooo, you decided to go fishing at the local pond, a place teeming with fish of all different sizes. You brought along a collection of baits, knowing that each one must be just the right size—strictly smaller than the fish—for the fish to bite. Each bait was special, capable of being used up to three times before it was no longer useful. Your goal was to catch as many fish as possible, but once a fish was caught, it would disappear from the pond, never to be seen again. The pond was a tricky place, and to catch the most fish, you knew you had to start with the biggest bait and work your way down, trying to hook the largest fish remaining each time, until your bait was either used up or not small enough to catch anything. With your strategy in mind, you embarked on this fishing adventure, aiming to see just how many fish you could haul from the pond before your baits were all used up.

Example 1:

Input:  fishing = [1, 2, 3], baitsss = [1]
Output: 2
Explanation:
With bait size baits[0] = 1, you can catch two fish from the pond: fish[2] = 3 and fish[1] = 2, since the bait size is strictly smaller than the size of these fish (1 < 3 and 1 < 2). However, the smallest fish, fish[0] = 1, cannot be caught using this bait since the bait size is not strictly smaller.
Constraints:
    🍇🍇
Thumbnail 0
Thumbnail 1
Testcase

Result
Case 1

input:

output: