Solved! Leetcode 958. Check Completeness of a Binary Tree

source: https://leetcode.com/problems/check-completeness-of-a-binary-tree/description/ Check Completeness of a Binary Tree Given the root of a binary tree, determine if it is a complete binary tree. In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 ...

Solved! Leetcode 101. Symmetric Tree

source: https://leetcode.com/problems/symmetric-tree/description/ Symmetric Tree Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3] Output: true Example 2: Input: root = [1,2,2,null,3,null,3] Output: false Constraints: The number of nodes in the tree is in the range [1, 1000]. -100 ...

Solved! Leetcode 72. Edit Distance

source: https://leetcode.com/problems/edit-distance/ Edit Distance Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations permitted on a word: Insert a character Delete a character Replace a character Example 1: Input: word1 = “horse”, word2 = “ros” Output: 3 Explanation: horse -> ...