We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
How did you figure out that the average value of all pixels in image must be compared against 80. I was thinking about setting comparison value to 255/2 as (I think) avg > 127.5 would be day and night otherwise.
Cookie support is required to access HackerRank
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 →
How did you figure out that the average value of all pixels in image must be compared against 80. I was thinking about setting comparison value to 255/2 as (I think) avg > 127.5 would be day and night otherwise.