Skip to content

Instantly share code, notes, and snippets.

@karina-clio
Last active March 10, 2025 17:38
Show Gist options
  • Select an option

  • Save karina-clio/aa96ed9de29867226eaca06125c78f62 to your computer and use it in GitHub Desktop.

Select an option

Save karina-clio/aa96ed9de29867226eaca06125c78f62 to your computer and use it in GitHub Desktop.

Revisions

  1. karina-clio revised this gist Aug 28, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    Given a CSV file of friends who want to be assigned in order to exchange gifts:

    1. Write a script that processes the CSV file (example file below)
    1. Write a script that processes a CSV file (use the example file below)
    2. Randomly assign givers to receivers
    3. Print each person's email followed by the email of the person they're assigned to (see example output below)

  2. karina-clio revised this gist Aug 28, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,15 @@ Given a CSV file of friends who want to be assigned in order to exchange gifts:

    1. Write a script that processes the CSV file (example file below)
    2. Randomly assign givers to receivers
    3. Print each person's email followed by the email of the person they're assigned to (see expected output below)
    3. Print each person's email followed by the email of the person they're assigned to (see example output below)

    Notes:
    Additional requirements:

    - A person cannot give a gift to themselves
    - Ensure everyone gives only one gift, and receives only one gift
    - It should be random - if we run the script multiple times we should get different results.

    Expected output:
    Example output:
    ```
    turner_it_around@hotmail.com -> spatel76@gmail.com
    spatel76@gmail.com -> ahmed@live.ca
  3. karina-clio revised this gist Aug 28, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    ## Gift Exchange

    I have a CSV file of friends who want to be assigned in order to exchange gifts.
    Given a CSV file of friends who want to be assigned in order to exchange gifts:

    1. Write a script that processes the CSV file below
    1. Write a script that processes the CSV file (example file below)
    2. Randomly assign givers to receivers
    3. Print each person's email followed by the email of the person they're assigned to (see expected output below)

  4. karina-clio revised this gist Feb 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    I have a CSV file of friends who want to be assigned in order to exchange gifts.

    1. Write a script that processes the CSV file below
    2. Randomly assign `givers` to `receivers`
    2. Randomly assign givers to receivers
    3. Print each person's email followed by the email of the person they're assigned to (see expected output below)

    Notes:
  5. karina-clio revised this gist Feb 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ I have a CSV file of friends who want to be assigned in order to exchange gifts.

    1. Write a script that processes the CSV file below
    2. Randomly assign `givers` to `receivers`
    3. Print each person's email followed by the email of the person they're paired with (see expected output below)
    3. Print each person's email followed by the email of the person they're assigned to (see expected output below)

    Notes:

  6. karina-clio revised this gist Jan 27, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ I have a CSV file of friends who want to be assigned in order to exchange gifts.

    Notes:

    - A person cannot give a gift to themself
    - A person cannot give a gift to themselves
    - Ensure everyone gives only one gift, and receives only one gift
    - It should be random - if we run the script multiple times we should get different results.

  7. karina-clio created this gist Jan 27, 2022.
    20 changes: 20 additions & 0 deletions gift_exchange.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ## Gift Exchange

    I have a CSV file of friends who want to be assigned in order to exchange gifts.

    1. Write a script that processes the CSV file below
    2. Randomly assign `givers` to `receivers`
    3. Print each person's email followed by the email of the person they're paired with (see expected output below)

    Notes:

    - A person cannot give a gift to themself
    - Ensure everyone gives only one gift, and receives only one gift
    - It should be random - if we run the script multiple times we should get different results.

    Expected output:
    ```
    turner_it_around@hotmail.com -> spatel76@gmail.com
    spatel76@gmail.com -> ahmed@live.ca
    ahmed@live.ca -> turner_it_around@hotmail.com
    ```
    4 changes: 4 additions & 0 deletions input.csv
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    Name,Email
    Alex,turner_it_around@hotmail.com
    Sahana,spatel76@gmail.com
    Ahmed Yahya,ahmed@live.ca