# Erect The Fence

• I just didn't understand the "the line qr should be having more slope than the line pq", so i find maybe the conduct product is a good explanation. if conduct product of pq and pr is positive, then the lines pq, pr is anticlockwise direction.

• @hell0123 The meaning of this line is that the line qr should be obtained by doing an anticlockwise rotation of the line pq, then only the point q can be more counter-clockwise to p than r. For the line qr to be obtained by anitclockwise rotation of pq, qr's slope should be more than pq's slope.

• why is this statement true: "in order for the point q to be more counterclockwise to p than the point r, the line qr should be having more slope than the line pq."?

Isn't in fact wrong in the example? the slope of qr is negative while the slope of pq is positive.

• @kevinchacon @hell0123 I have updated the statement. I hope the current explanation seems more logical.

• @vinod23 ok, thank you.

• @vinod23 Thanks :)

• Solution listed under Jarvis Algorithm failed this test case:
[[1,2],[2,2],[4,2],[5,2]]

• @bobw Thanks for pointing it out. I have updated the code. Please have a look.

• @vinod23 Thanks :)

• In monotone chain appoach, what are the cases so we need to create new HashSet?
Is it just to avoid duplication of first point that will be added in the end? Maybe we can just do hull.pop() before returning the result

• @ykvarts We need hashset because of collinear points. Consider the case- input contains only three collinear points. Then left-right scan and right-scan give the same result. Thanks.

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.