SHARE
TWEET

Untitled

a guest Jun 26th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def solution(A):
  2.     f,s,t,l = [],[],[],[]
  3.     Bx,By = 0,0
  4.     for ii in range(len(A)):
  5.         x,y = A[ii].x, A[ii].y
  6.         m = (y)/(x)
  7.         if x>0 and y>0:
  8.             f.append(m)
  9.         elif x<0 and y>0:
  10.             s.append(m)
  11.         elif x<0 and y<0:
  12.             t.append(m)
  13.         else:
  14.             l.append(m)
  15.     return (len(set(f))+len(set(s))+len(set(t))+len(set(l)))
  16.  
  17.  
  18.  
  19.  
  20. ip_array = [(-1, -2), (1, 2), (2, 4), (-3, 2), (2, -2)]
  21.  
  22. ans = point2D.solution(ip_array)
  23. print(ans)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top