Advertisement
enigmjoe

Big O day 1

Aug 7th, 2023
941
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. def kangaroo(x1, v1, x2, v2):
  2.     a , b = x1 , x2
  3.     if(v1 <= v2):
  4.         return "NO"
  5.     while a <= b:
  6.         if(a == b):
  7.             return "YES"
  8.         a += v1
  9.         b += v2
  10.     return "NO"
  11.  
  12. def diagonalDifference(arr):
  13.     a = 0
  14.     b = 0
  15.  
  16.     for i in range(n):
  17.         a += arr[i][i]
  18.         b += arr[i][n - i - 1]
  19.     return abs(a - b)
  20.  
  21. def maxMin(m, A):
  22.     A.sort()
  23.     mn = 10**9 + 1
  24.     i , j = 0 , m - 1
  25.     while j < n:
  26.         mn = min(A[j]- A[i] , mn)
  27.         j += 1
  28.         i += 1
  29.     return mn
  30.  
Advertisement
Comments
  • prashant0695
    1 year
    # text 0.30 KB | 0 0
    1. You can set the frame height by adding the CSS value 'height:100px;' for example:
    2. <iframe src="https://pastebin.com/embed_iframe/wqJtLb3e" style="border:none;width:100%"></iframe>
    3. Enable dark theme:
    4. <iframe src="https://pastebin.com/embed_iframe/wqJtLb3e?theme=dark" style="border:none;width:100%"></iframe>
  • prashant0695
    1 year
    # text 0.30 KB | 0 0
    1. You can set the frame height by adding the CSS value 'height:100px;' for example:
    2. <iframe src="https://pastebin.com/embed_iframe/wqJtLb3e" style="border:none;width:100%"></iframe>
    3. Enable dark theme:
    4. <iframe src="https://pastebin.com/embed_iframe/wqJtLb3e?theme=dark" style="border:none;width:100%"></iframe>
Add Comment
Please, Sign In to add comment
Advertisement