# Print all sub-arrays of an array with distinct elements

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/1133/sub-arrays-distinct-elements
Source observed: 2026-11-05T00:50:18.190Z
Last checked: 2026-11-05T00:50:18.19+00:00
Indexed: 2026-11-07T03:03:00.009+00:00

---

# Print all sub-arrays of an array with distinct elements

We provide this coding-interview question in our Aced interview-preparation question library. The task concerns printing every contiguous sub-array of an array whose elements are distinct. The supplied question contains no problem statement, constraints, examples, solution, or contributed answer beyond its title.

[All Questions](https://www.aced.io/questions)

## Community answers

No answers have been contributed by the community yet.

## Related questions

- [Given an array of integers, print all subarrays that sum to zero.](https://www.aced.io/questions/964/subarrays-with-zero-sum)
- [Replace each element in the array with the product of all other elements without using the division operator.](https://www.aced.io/questions/1121/replace-elements-array-product-other-elements)
- [Partition an array into two sub-arrays with equal sum.](https://www.aced.io/questions/969/partition-array-equal-sum)

## Your answer

Sign in or sign up to answer this question. Submitting an answer marks the question complete.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F1133%2Fsub-arrays-distinct-elements&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%2F1133%2Fsub-arrays-distinct-elements). Opening a form does not execute a tool.