Choose Language Hide Translation Bar
Challenge 4

jmp-challenge-v2.pngThings have been busy the last few weeks, and I’m still pulling together a write up for the previous JMP Challenge. I hope to have something out by the end of this week or beginning of next. In the meantime, how about another challenge?

We’ll keep this one easy, since I suspect you’re as busy as me. As a follow-on to last month’s challenge, I want you to create a function, multiplyBig(a,b), where, like the last challenge, a and b are text strings comprised only of integers and, possibly, the negative sign as the first character. The function should treat a and b as very large integers and return their product. The inputs a and b will not necessarily have the same number of digits or have the same sign.

Scoring

  1. Eight points for a version that can correctly multiply 100 pairs of 100-digit numbers.
  2. Three additional points to the implementation that can do this the quickest for 100 pairs of 1,000-digit numbers (2 points for second, 1 for third).
  3. Three additional points for the implementation that can multiply the largest pair of equal length numbers in under 5 seconds (2 for second, 1 for third).

The same numbers will be used to test all entries. You only need to consider using two text string inputs; I will take care of looping over all pairs of numbers when I test the entries.

The deadline for entries is is 11:59 PM Eastern (US) time Wednesday, July 15. Post your entries here in comments. I will consider only one entry per person. Points will be awarded each month to the top-performing scripts based on criteria appropriate for the challenge. While the challenge is going on, I will moderate the comments section to keep hints, clues, submissions, etc., from inadvertently getting out. I will let you know when I receive your entry. Refer to the first challenge for all the rules.

Good luck!

Article Labels
Article Tags
1 Comment
Staff (Retired)

numbers you can test with here:

https://en.wikipedia.org/wiki/RSA_numbers