add O(1) sol for flat BT