Triplet whose sum in range (1,2)
The trick is to figure out a way to categorize the possible solutions and come up with a linear-time constant-space solution for each. Consider the three ranges X = (0,2/3), Y = [2/3,1], Z = (1,2). At most one value can come from Z (if two values came from Z, then the sum would exceed … Read more