class P def main args = CobraCore.commandLineArgs[1:] if args.count <> 1 print 'error: specify a filename' return fileName = args[0] d = Dictionary() for line in File.readAllLines(fileName) if d.containsKey(line), d[line] += 1 else, d[line] = 1 pairs = List>() for pair in d, pairs.add(pair) pairs.sort(do(a as KeyValuePair, b as KeyValuePair)=a.value.compareTo(b.value)) for line, count in pairs if count > 1 print count, line