Rodolfo Guluarte Hale

LeetCode

LeetCode: [226] Invert Binary Tree

Solution For this problem we just solve the base problem for a tree with children, and then we use recursion to bubble up the changes.

LeetCode: [121] Best Time to Buy and Sell Stock

You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from …

LeetCode: [21] Merge Two Sorted Lists

Problem You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list. Example 1: