I think the 22/10/1901 was a Tuesday... :-/
http://www.infoplease.com/calendar.php?month=10&year=1901&submit=Go
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.
9873 Solvers
624 Solvers
Rotate input square matrix 90 degrees CCW without rot90
380 Solvers
Numbers spiral diagonals (Part 1)
95 Solvers
214 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!