imashutosh51

Unique Binary Search Trees

May 25th, 2026
51
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. # Definition for a binary tree node.
  2. # class TreeNode:
  3. #     def __init__(self, val=0, left=None, right=None):
  4. #         self.val = val
  5. #         self.left = left
  6. #         self.right = right
  7. # Definition for a binary tree node.
  8. # class TreeNode:
  9. #     def __init__(self, val=0, left=None, right=None):
  10. #         self.val = val
  11. #         self.left = left
  12. #         self.right = right
  13.  
  14. class Solution:
  15.     def generateTrees(self, n: int) -> List[Optional[TreeNode]]:
  16.  
  17.         dp = {}
  18.  
  19.         def generate(left, right):
  20.  
  21.             if left > right:
  22.                 return [None]
  23.  
  24.             if (left, right) in dp:
  25.                 return dp[(left, right)]
  26.  
  27.             res = []
  28.  
  29.             for val in range(left, right + 1):
  30.  
  31.                 leftTrees = generate(left, val - 1)
  32.                 rightTrees = generate(val + 1, right)
  33.  
  34.                 for l in leftTrees:
  35.                     for r in rightTrees:
  36.  
  37.                         root = TreeNode(val)
  38.                         root.left = l
  39.                         root.right = r
  40.  
  41.                         res.append(root)
  42.  
  43.             dp[(left, right)] = res
  44.             return res
  45.  
  46.         if n == 0:
  47.             return []
  48.  
  49.         return generate(1, n)
Advertisement
Comments
  • Apqunaz
    4 days
    # CSS 0.92 KB | 0 0
    1. ✅ Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1WhlQi8xpq819kqTE2nXcZTAeCgQ5m-ic2pm_7IZVt7w/edit?usp=sharing
    4.  
    5. This made me $12,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
    8.  
    9. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    10.  
    11. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).
    12.  
    13. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment