Flawed solution (same flaw as Solution 1327329).
This is an incorrect solution. For example, suppose dx = [0,1,0,-1], dy = [2,0,2,0], x = 1 and y = 5 (which is the same situation as test #1 but with a slightly different dy); then this code would return 'True' when in fact the correct answer would obviously be 'False'.
[Based on solution 1227987] Although this solution passes the test suite, it (and several others like it) is an incorrect solution. For example, suppose dx = [-1,-1,-1,2,-1,6], dy = [-1,-2,-3,1,1,-1], x = 53 and y = -71 (which is the same situation as test #5 but with a slightly different dy); then this code would return 'True' when in fact the correct answer is 'False'.
I still don't understand the scoring system I guess.
Seems odd to me that the commented solution had size 43 ... but doing extra computation reduced this solution to size 33.
(unless JIT is at the level to implicitly convert?)
Although this has passed the tests, I don't think it is correct, since it allows the fly to go backwards in time as well as forwards.
no bonus points for me :(
Read a column of numbers and interpolate missing data
Rotate and display numbered tile
Return elements unique to either input
Given area find sides
03 - Matrix Variables 2
Clockwise or Counterclockwise
Knave in the middle attack
singularity 2.0 (hard)
feeling VERY lucky?
Hackathon: the beginnings
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