I think the 22/10/1901 was a Tuesday... :-/
Its not like using datestr and solving this. You need to calculate the days and divide it by 7, take the reminder and increment that many days to present day.
Problem statement would be much better with an additional sentence:
"Solve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday."
Otherwise this is just lame.
Really, Bainhome...the problem is not 'some function you did not grasp' but the logic applied in solving this particular mathematical problem. :)
I'll suggest you take a relativistic approach as opposed to @Vivek comment. Goodluck.
To be honest, this one took me a while...and when it finished, my first thought is: code like that should considered as a crime...let me think this through.Thx man!
have to admit, this code and the one alfonso wrote are really elegant. I will look into it tomorrow.
surface of a spherical planet
Convert Roman to Arabic Numerals
Decode a simplified barcode
Circular Primes (based on Project Euler, problem 35)
Sum the Digits of a Number
Check if it is a square or cube of consecutive numbers
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office