You are viewing a single comment's thread. Return to all comments →
Passed all test Cases. import numpy as np
rgb_col = input().split()
arr = []
for item in rgb_col: val = list(map(int, item.split(','))) gray = 0.21*int(val[0]) + 0.72*int(val[1]) + 0.07*int(val[2]) arr.append(gray)
hist = np.histogram(arr, 255, [0,256], density = True)[0]
if hist[:100].sum() > 0.50: print('night') else: print('day')
Seems like cookies are disabled on this browser, please enable them to open this website
Digital Camera Autodetect: Day or Night
You are viewing a single comment's thread. Return to all comments →
Passed all test Cases. import numpy as np
rgb_col = input().split()
arr = []
for item in rgb_col: val = list(map(int, item.split(','))) gray = 0.21*int(val[0]) + 0.72*int(val[1]) + 0.07*int(val[2]) arr.append(gray)
hist = np.histogram(arr, 255, [0,256], density = True)[0]
if hist[:100].sum() > 0.50: print('night') else: print('day')