Coding Exercise Posts - page 23 of 43

Recent posts

Sum of the Deepest Nodes

less than 1 minute read

Given a binary tree root, find the sum of the deepest node values.

Sum of Right Leaves

less than 1 minute read

Given a binary tree root, return the sum of all leaves that are right children.

Sum of First N Odd Integers

less than 1 minute read

Given an integer n, return the sum of the first n positive odd integers.

Sum of Digit Paths in a Tree

less than 1 minute read

You are given a binary tree root with each node containing single digits from 0 to 9. Each path from the root to the leaf represents a number with its digits...

Subtree

less than 1 minute read

You are given two binary trees root, and target. Return whether target is a subtree of root — that is, whether there’s a node in root that is identically sam...

Subtree with Maximum Average

1 minute read

Given a binary tree root, return the maximum average value of a subtree. A subtree is defined to be some node in root including all of its descendants. A sub...

Substringify

less than 1 minute read

Given two lowercase alphabet strings s and t, return the minimum amount of operations on s required to make t a substring of s. In each operation, you can ch...

Stuck Keyboard

1 minute read

You are given two strings typed and target. You want to write target, but the keyboard is stuck so some characters may be written 1 or more times. Return whe...

String Isomorphism

1 minute read

Given lowercase alphabet strings s, and t return whether you can create a 1-to-1 mapping for each letter in s to another letter (could be the same letter) su...

String Addition

less than 1 minute read

Given two strings a, and b, both representing an integer, add them and return it in the same string representation.