« first day (4853 days earlier)   

8:49 AM
CMC Given an image, output the width of the margin on each side [top, right, bottom, left] The margin is the biggest solid rectangular region extending from each side with the same color as the top left pixel. There is guaranteed to be at least 1px margin on each side.
 
 
3 hours later…
11:30 AM
@mousetail is the margin the same color on each side?
 
11:48 AM
@mousetail I assume any reasonable input form is allowed?
 
12:28 PM
is the image guaranteed to have a foreground?
 
1:14 PM
ahh, ap tests. taken at a time when i was somehow still not at my stress maximum during my education (that was junior year in college)
passed cs with a 4, physics 1 with a 3, failed spanish and chinese lmao
 
1:40 PM
@Adám Yes and Yes
@Neil Yes
 
@mousetail How about giving the result in a different but consistent order?
 
That's also fine
 
Valid?
https://tio.run/##xVK9alZBEO19in2BwM7Mzl9hZWNakxe48H1JE9TCwiBWgWA@ckNS@AKGEJGAjZYh4KPsi3yejbZysRBZuDt7dubM2XNnen20szqejl4d7qzfvlm/XK1X2@27Pp/18/s@f@@b637xsZ9e9s1Nnz/3D7f9/AH4@z5ft7759LRvTrYH436@QNjnuz5/@/FV@ukV6vZePMN3//nu3nZCTi1UcV2fTH3@gnMoEQmXP@1/Ffze/yd3ttpSc9QlcWopBEQIQYpqhBWiqtQanHgEohZpgeJFT4qZuRsow0kaAmeLOpqYeLoR2taIdBq57FmtOLob2yK3hjo0FRFuICukAVmBl4DXU3kglawCUR9JCh3ZtMWi38SoEzjR3FUdI4BlFKW0BMTgZgmmgG5lNGUtFilwa4m7kTh8BkEdHoBSoY2slcJpQTmsEHXl4V9qtUARh4roEjdVNpPxXpWAcARoVTkerVBWAZLsSAPilIFuAb@xlrgl4EjEUMlKIxizAV74HeSOgSFTNaqwC4Miv34OkaX80/k@KNNP
 
I can't easily tell because it's a bit hard to input images but it seems good based on the example given.
If it's implemented correctly it should give the same result with the colors inverted
 
1:56 PM
Yeah, hang on, I'll make an ATO link with a couple of examples, including having the margin colour appear in the middle, and on ATO we also avoid the spurious Boolean result.
 

« first day (4853 days earlier)