This post originally appeared on Arjun Rajkumar's blog. Arjun is a web developer based in Bangalore, India.
--
I'm going to spend 1-2 hours/day ...
For further actions, you may consider blocking this person and/or reporting abuse
This was my logic for doing this.
Logic:
It works with these few example cases:
Examples: [10, 7, 5, 8, 11, 9] -> 6 ; [10, 7, 100, 8, 11, 9] -> 92 ; [10] -> 0 ; [10, 2] -> 0.
Code:
Github
In ruby