首页 > 其他 > 详细

[LeetCode] Valid Square 验证正方形

时间:2017-05-28 00:18:03      阅读:409      评论:0      收藏:0      [点我收藏+]

 

Given the coordinates of four points in 2D space, return whether the four points could construct a square.

The coordinate (x,y) of a point is represented by an integer array with two integers.

Example:

Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1]
Output: True

 

Note:

  1. All the input integers are in the range [-10000, 10000].
  2. A valid square has four equal sides with positive length and four equal angles (90-degree angles).
  3. Input points have no order.

 

s

 

 

 

 

[LeetCode] Valid Square 验证正方形

原文:http://www.cnblogs.com/grandyang/p/6914746.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!