Again, good problem, but it would be better if base-10 or base-2 was adopted as a standard at the description
"The hard way to go about it, but it worked like a charm!" :-)
If you think this one is ugly (and I agree 100% it is!) you should have seen my first few attempts, which included using "typecast" to get the numbers as uint64s and trying to compare them that way. At least this one worked...eventually.
James, actually, it's interesting on Cody to get to see things from another point of view. Kudos for original thinking :-) —DIV
Return the largest number that is adjacent to a zero
3750 Solvers
1309 Solvers
Project Euler: Problem 3, Largest prime factor
379 Solvers
Construct a string from letters and counts
128 Solvers
Are all the three given point in the same line?
270 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!