Skip to content

Instantly share code, notes, and snippets.

View Baba-A's full-sized avatar

Abubakar (Baba) Awumbila Baba-A

View GitHub Profile
@Baba-A
Baba-A / README.md
Created September 24, 2012 04:35 — forked from danielnegri/README.md
LastFM - Ranking

Exercise

Description

The attached utf-8 encoded text file contains the favorite musical artists of 1000 users from LastFM. Each line is a list of up to 50 artists, formatted as follows:

  • Radiohead, Pulp, Morrissey, Delays, Stereophonics, Blur, Suede, Sleeper, The La's, Super Furry Animals
  • Band of Horses, Iggy Pop, The Velvet Underground, Radiohead, The Decemberists, Morrissey, Television

Write a program that, using this file as input, produces a list of pairs of artists which appear TOGETHER in at least fifty different lists. For example, in the above sample, Radiohead and Morrissey appear together twice, but every other pair appears only once. Your program should output the pair list to stdout in the same form as the input.