← AlgoMindset 75

Successful Pairs of Spells and Potions

Medium🎙 Interview me on this

🧠 Before you code — what pattern fits?

Given arrays spells and potions and an integer success, a pair (spell, potion) is successful if spell × potion ≥ success. For each spell, return how many potions form a successful pair with it.

(spells=[5,1,3], potions=[1,2,3,4,5], success=7) → [4,0,3]

🎬 Video explanation · NeetCodeIO

Your solution runs against 2 unit tests, including edge and large-value cases.

Loading...

Test console · 2 unit tests

Submit your code to run it against all 2 unit tests. Results appear here.

JavaScript, TypeScript & Python run sandboxed in your browser; other languages run on the execution server. Your code is saved locally as you type.