# Total Outfit Combinations — Coding Question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3724/total-outfit-combinations
Source observed: 2026-11-05T01:40:46.944Z
Last checked: 2026-11-05T01:40:46.944+00:00
Indexed: 2026-11-07T03:21:56.739+00:00

---

# Total Outfit Combinations

We provide this **Easy** coding interview question for practicing combinatorics and Python. It concerns a wardrobe containing pants, shirts, and hats. The question is listed for **Data Scientist** roles, associated with **Oracle**, and categorized under **Coding**.

- [All Questions](https://www.aced.io/questions)
- Reported last asked: 2 years ago
- [Upgrade to unlock detailed company stats](https://www.aced.io/upgrade?src=questions)

## Problem

You are given a wardrobe containing pants, shirts, and hats. For each clothing category, you receive both the total number of items and the number of unique types.

Each item can be combined with items from the other categories. An outfit contains:

- One pair of pants
- One shirt
- Optionally, one hat

Write `count_unique_outfits` to return the total number of unique outfits, counting outfits both with and without hats.

## Python function signature

```python
def count_unique_outfits(total_pants: int, unique_pants: int,
                          total_shirts: int, unique_shirts: int,
                          total_hats: int, unique_hats: int) -> int:
    pass
```

## Input

- `total_pants` (`int`): Total number of pants in the wardrobe. `1 ≤ total_pants ≤ 1000`.
- `unique_pants` (`int`): Number of unique types of pants. `1 ≤ unique_pants ≤ total_pants`.
- `total_shirts` (`int`): Total number of shirts in the wardrobe. `1 ≤ total_shirts ≤ 1000`.
- `unique_shirts` (`int`): Number of unique types of shirts. `1 ≤ unique_shirts ≤ total_shirts`.
- `total_hats` (`int`): Total number of hats in the wardrobe. `1 ≤ total_hats ≤ 1000`.
- `unique_hats` (`int`): Number of unique types of hats. `1 ≤ unique_hats ≤ total_hats`.

## Output

Return an integer representing the total number of unique outfit combinations, including outfits with and without hats.

## Example

```python
count_unique_outfits(2, 1, 1, 1, 3, 2)  # returns 3
```

The sample wardrobe is:

- 2 red pants, representing 1 unique pants type
- 1 blue shirt, representing 1 unique shirt type
- 2 white hats and 1 black hat, representing 2 unique hat types

The resulting unique outfits are:

1. Red pants + blue shirt + no hat
2. Red pants + blue shirt + white hat
3. Red pants + blue shirt + black hat

Therefore, the sample produces **3 unique outfits**.

The surrounding example text also says that there are “18 unique outfit combinations,” which conflicts with the listed inputs and the three enumerated outfits. We retain the enumerated result and the function example as `3`.

## Community

No community answers have been contributed yet. The question interface includes Question, Solution, and Community tabs; the Community tab shows 4 items in the rendered interface.

## Related courses

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies through mock interviews, frameworks, and advice from senior candidates. Topics include statistics, experimentation, coding, SQL, machine learning, and behavioral interviews.

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [SQL Interviews](https://www.aced.io/courses/sql-interviews)

We help candidates prepare for SQL interviews by practicing syntax basics, aggregations, and window functions. The course covers manipulating data, writing complex queries, and analyzing information from diverse data sets.

![SQL Interviews](https://images.ctfassets.net/x78yjrjc11pq/62mN54S54HpLIOmyG8qbnq/54deaf5e397d0807d71c0e27e21e5ee3/sql_illustration_2.jpg?w=800&h=800&fm=webp&q=75)

## Running code

The embedded Python editor includes Editor, Share, Output, Test Results, and Console views. Running code requires an account: [Sign up to run code](https://www.aced.io/signup?src=lesson).

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3724%2Ftotal-outfit-combinations&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3724%2Ftotal-outfit-combinations). Opening a form does not execute a tool.