SIG Algorithm Challenge 1: Duplicate Digits

Solutions (any language) due at Midnight on Thursday (02/22/2018)

The Problem

Write a program that will print out all duplicate numbers within a given number. For example:


Input: 2949171283124591491

491: 2 times, 49: 2 times, 91: 3 times, 12: 2 times


You only need to account for duplicate numbers with two or more digits (do not worry about 1, 2, 3…)

The Requirements

  • Your program must take in user input (so that I can feed it test cases)
  • Your program must output all duplicate numbers and the number of times that they occur
  • You can use any language for this program

Scoring

100 points just for showing up to our weekly SIG meetings.

200 points for a working solution! It doesn’t matter how it works or how fast it works, as long as it gets the job done in a reasonable amount of time. The only caveat is if you copy code from the internet, in which case you’ll be disqualified (and immediately put on Santa’s naughty list.)

500 points for using a tree, doing this without converting the input to a string, having a particularly clever choice of algorithm, or for using a challenging language (if you go this route, be sure to also tell me how I can run your program.)

Send all solutions/questions/concerns to ms2286@njit.edu

Advertisements
%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close