Debian Setup
Debian Setup

Debian Setup

sudo apt update && sudo apt install git && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && echo >> ~/.bashrc && echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> ~/.bashrc && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)" && sudo apt-get install build-essential && brew install gcc btop
Backlinks (1)
  • 260415
260406
260406

260406

  • Handling Agents with Love
  • Separating Claude Code Personal Sub and Claude Code Company Sub
Backlinks (0)

No backlinks found.

Stella
Stella

Stella

OpenClaw, Hermes, Poke를 쓰며 느낀 단점들

내가 만약 워크스페이스 에이전트를 만든다면 어떻게 만들까?

메모리

  • 육하원칙에 맞게 기억해야하는데, 이걸 잘 못 함
    • 맥락을 종종 헷갈려함
  • 메모리 툴을 명시적으로 불러야 함
    • 이는 Hermes에서 많이 완화된 부분

Slack

  • 답장을 매번 하려 함. 쓰레드에 달리는 모든 글에 답을 함.
    • 매번 답할 필요는 없음. 필요할 때만 하면 됨.
  • 언급하지 않은 메시지는 읽지 않음.
    • 모든 워크스페이스의 변화를 계속 보고 있어야 함, 그리고 기억해야 함
Backlinks (2)
  • 260419
  • 260411
Definition for a binary tree node.
Definition for a binary tree node.

Definition for a binary tree node.

Solved at: 220925

Question

Given a binary tree, determine if it is height-balanced.

For this problem, a height-balanced binary tree is defined as:

a binary tree in which the left and right subtrees of every node differ in height by no more than 1.

Solution

python
# Definition for a binary tree node.# class TreeNode:#     def __init__(self, val=0, left=None, right=None):#         self.val = val#         self.left = left#         self.right = rightclass Solution:
    def getHeight(self, node):        if node == None:            return 0        l = node.left        r = node.right        return max(self.getHeight(l), self.getHeight(r)) + 1
    def isBalanced(self, root: Optional[TreeNode]) -> bool:        if root == None:            return True        l = root.left        r = root.right        lh = self.getHeight(l)        rh = self.getHeight(r)        return abs(lh - rh) <= 1 and self.isBalanced(l) and self.isBalanced(r)

Results

Runtime

  • 123 ms, faster than14.05%ofPython3online submissions forBalanced Binary Tree.

Memory Usage

  • 18.6 MB, less than90.53%ofPython3online submissions forBalanced Binary Tree.

Complexity Analysis

Time

  • O(nlog⁡n)O(n \log n)O(nlogn) because worst case, we might need to travel all nodes while counting their height with O(n)O(n)O(n)

Space

  • O(n)O(n)O(n) because we require a stack to contain all nodes, worst case.

Other Answers Online

Backlinks (2)
  • 220925
  • Coding Tests
Index
cho.sh
I prefer CLIBB9A08260619260619컴퓨트로늄37A88F컴퓨트로늄0CF03F컴퓨트로늄2C60FB260618260618260418260418260528260528AutoBuilder63849A260419260419Setup9AC296StellaD226F7260415260415Debian SetupD2F701260414260414anaclumos/configs/AGENTS.mdED86A3Ramp의 AX (회사를 AI로 물들이는 법)840774260413260413How to get your company AI pilled46544C260411260411260409260409260407260407260406260406Separating Claude Code Personal Sub and Claude Code Company Sub33A53C
sudo apt update && sudo apt install git && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && echo >> ~/.bashrc && echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> ~/.bashrc && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)" && sudo apt-get install build-essential && brew install gcc btop
Warning
This post is more than a year old. Information may be outdated.
# Definition for a binary tree node.# class TreeNode:#     def __init__(self, val=0, left=None, right=None):#         self.val = val#         self.left = left#         self.right = rightclass Solution:
    def getHeight(self, node):        if node == None:            return 0        l = node.left        r = node.right        return max(self.getHeight(l), self.getHeight(r)) + 1
    def isBalanced(self, root: Optional[TreeNode]) -> bool:        if root == None:            return True        l = root.left        r = root.right        lh = self.getHeight(l)        rh = self.getHeight(r)        return abs(lh - rh) <= 1 and self.isBalanced(l) and self.isBalanced(r)