---
title: "Discussion on \"Pairs from an array\" | Hashnode"
description: "Discussion on \"Pairs from an array\". Input \n[1,2,3,4]\nOutput\n[(1, 2), (3, 4)]\n[(1, 3), (2, 4)]\n[(1, 4), (2, 3)]\nKey ideas\n\nWe want to generate combinations from the input, and we don't know how many combinations there are -> this is a hint to use the backtracking strategy\nWhen we pick a..."
url: "https://hashnode.com/posts/pairs-from-an-array/63274bc4b1a2e9b8401e1239"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Pairs from an array](https://brianhu.hashnode.dev/pairs-from-an-array?utm_source=hashnode&utm_medium=feed)

Input \[1,2,3,4\] Output \[(1, 2), (3, 4)\] \[(1, 3), (2, 4)\] \[(1, 4), (2, 3)\] Key ideas We want to generate combinations from the input, and we don't know how many combinations there are -> this is a hint to use the backtracking strategy When we pick a...

Sep 18, 2022 · 2 min read · brianhu.hashnode.dev  
Read the article

-   [#backtracking](https://hashnode.com/tag/backtracking)

## Written by

[Brian Hu](https://hashnode.com/@brianhu)

@brianhu

  
[View profile](https://hashnode.com/@brianhu)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
