码迷,mamicode.com
首页 > 其他好文 > 详细

[LeetCode] Valid Square 验证正方形

时间:2017-05-28 00:29:39      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:tco   tput   space   question   const   order   return   eth   div   

 

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 验证正方形

标签:tco   tput   space   question   const   order   return   eth   div   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!