998-Maximum-Binary-Tree-Ii

Sat 17 May 2025

https://leetcode.com/problems/maximum-binary-tree-ii

import pyutil as pyu
pyu.get_local_pyinfo()
print(pyu.ps2("python-dotenv"))
from typing import List
class Solution:
  def insertIntoMaxTree(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]:
    if not root:
      return TreeNode(val)
    if root.val < val:
      return TreeNode(val, root, None)
    root.right = self.insertIntoMaxTree …

Category: leetcode

Read More

999-Available-Captures-For-Rook

Sat 17 May 2025

https://leetcode.com/problems/available-captures-for-rook

import pyutil as pyu
pyu.get_local_pyinfo()
print(pyu.ps2("python-dotenv"))
from typing import List
class Solution:
  def numRookCaptures(self, board: List[List[str]]) -> int:
    ans = 0

    for i in range(8):
      for j in range(8):
        if board[i][j] == 'R':
          i0 = i
          j0 = j …

Category: leetcode

Read More

Zzemp-2885

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
# print(pyu.ps2("scipy"))
# from typing import List 

Solution().

Score: 5

Category: leetcode

Read More
Page 77 of 77

« Prev