How to Tilt a Binary Tree in Java
The challenge
Given the root of a binary tree, return the sum of every tree node’s tilt.
The tilt of a tree node is the absolute difference …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Given the root of a binary tree, return the sum of every tree node’s tilt.
The tilt of a tree node is the absolute difference …
Read Article →You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only …
Read Article →You have an initial power of P, an initial score of ``, and a bag of tokens where tokens[i] is the value of the …
Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and …
You will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and …
Read Article →Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique character.
Return …
Read Article →Write a function to convert a name into initials. This challenge strictly takes two words with one space in between them.
The output …
Read Article →Sort a linked list using insertion sort.

A graphical example of insertion sort. The partially sorted list (black) initially contains …!-->
Read Article →The goal is to create a function that removes the first and last characters of a string. You don’t have to worry with strings with …
Read Article →There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to …
Read Article →You have n candies, the i<sup>th</sup> candy is of type candies[i].
You want to distribute the candies equally between a …
Read Article →You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the i<sup>th</sup> …