Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Detect Overlapping Circles in React

Prompt

Render a set of draggable circles on a canvas or positioned div. After each drag detect whether any two circles overlap geometrically using the distance formula. Highlight overlapping circles visually. Support multiple circles simultaneously.

Two circles overlap if: sqrt((x2-x1)² + (y2-y1)²) < r1 + r2. On every drag-end re-check all pairs O(n²). Store circles as array of {id
Test Results

Detect Overlapping Circles in React

Render a set of draggable circles on a canvas or positioned div. After each drag detect whether any two circles overlap geometrically using the distance formula. Highlight overlapping circles visually. Support multiple circles simultaneously.