We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Jim and the Jokes
Jim and the Jokes
Sort by
recency
|
45 Discussions
|
Please Login in order to post a comment
Specially for the PSIT Students :)
Here’s a brief of the “Jim and the Jokes” problem from HackerRank:
The classic example:** why do programmers mix up Christmas and Halloween? Dec 25 (in decimal, 25) = Oct 31 (in octal, 31).**
Problem Statement Highlights:
You’re given a list of special event dates (each date is a (month, day) pair).
For each date, treat the month as the base and the day as the number: “day (in base month).”
Find all distinct pairs of dates such that converting the day to decimal using the month's value as the base gives the same result for both dates.
Extra Details & Constraints:
All numbers will use only the digits 0-9 (so bases above 10 can’t have normal digits).
If a day has a digit greater than or equal to the month, it’s invalid in that base, so skip that possibility.
You need to count all distinct pairs: if the same date appears multiple times, count all unique pairs among them (e.g., if the same pair appears 3 times, 3C2 = 3 possible jokes).
No need to worry about leap days.
Here is the simple solution in CPP :
Input: n lines of (month, day) Output: Single integer: total number of valid jokes possible with the event list.
Totally agree — the wording is confusing. We deal with similar clarity issues in mold reports here in Atlanta. Precise language makes all the difference!
if jim is out of jokes just to entertain his customers, tell jim that maybe he can sing or dance just to entertain his customer .. the real problem is how to entertain the customer .
100000
12 31
12 31
12 31
12 31
12 31
12 31 and so on for this test case how is the answer 499950000???
12 31
12 31