r/dailyprogrammer • u/jnazario 2 0 • Mar 02 '18
Weekly #28 - Mini Challenges
So this week, let's do some mini challenges. Too small for an easy but great for a mini challenge. Here is your chance to post some good warm up mini challenges. How it works. Start a new main thread in here.
if you post a challenge, here's a template we've used before from /u/lengau for anyone wanting to post challenges (you can copy/paste this text rather than having to get the source):
**[CHALLENGE NAME]** - [CHALLENGE DESCRIPTION]
**Given:** [INPUT DESCRIPTION]
**Output:** [EXPECTED OUTPUT DESCRIPTION]
**Special:** [ANY POSSIBLE SPECIAL INSTRUCTIONS]
**Challenge input:** [SAMPLE INPUT]
If you want to solve a mini challenge you reply in that thread. Simple. Keep checking back all week as people will keep posting challenges and solve the ones you want.
Please check other mini challenges before posting one to avoid duplications (within reason).
View all comments
Show parent comment
1
u/zatoichi49 Mar 09 '18 edited Mar 13 '18
Date Selection Overlap
Method:
Strip out any separators by filtering the string to only keep the alpha-numeric characters. If the date contains a written month, replace with the numerical value of the month. Rearrange the date into the format yyyymmdd and convert to an integer, and return True if there are any overlaps in the date ranges. Accepts any string in the format ddmmmyyyy or ddmmyyyy with any combination of separators.
Python 3:
Output: