All problems
Solarize
Problem
Apply a solarize effect to a grayscale image.
Pixels strictly greater than threshold are inverted with 255 - v; all other pixels are left unchanged.
Test cases
case 1
in: [[[0,255],[128,100]],127]
expected: [[0,0],[127,100]]
case 2
in: [[[200,201]],200]
expected: [[200,54]]
case 3
in: [[[0,0],[0,0]],0]
expected: [[0,0],[0,0]]
Starter codePython
def solarize(image, threshold):
# Your code here
pass3 test cases · run your code against them in the editor