Count Paths Visiting Exactly One Shop of Each Type

Problem

A town contains four types of shops, encoded by integers from 0 to 3:

  • 0: bookshop
  • 1: school supplies shop
  • 2: sports store
  • 3: stationery store

You are given an array `...

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: