Visit Required Attractions Without Reusing a Trail

Given an undirected graph of attractions and trails, and a list of required attractions, determine whether there exists a route such that:

  1. The route may start at any attraction.
  2. Every requi...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: