# LeetCode Solutions and Explanations

Here is a list of LeetCode problems solved by Goodtecher. Goodtecher will keep updating solutions and explains to LeetCode problems.…

Be a Good Techer and Tech for Good. www.goodtecher.com

Here is a list of LeetCode problems solved by Goodtecher. Goodtecher will keep updating solutions and explains to LeetCode problems.…

Description https://leetcode.com/problems/majority-element-ii/ Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Follow-up: Could you solve…

Description https://leetcode.com/problems/matrix-block-sum/ Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has…

Description https://leetcode.com/problems/matrix-block-sum/ Given a m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for: i – k <=…

Description https://leetcode.com/problems/maximum-product-of-three-numbers/ Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: Input:…

Description https://leetcode.com/problems/linked-list-cycle-ii/ Given a linked list, return the node where the cycle begins. If there is no cycle, return null. There…

Description https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii/ Given two nodes of a binary tree p and q, return their lowest common ancestor (LCA). Each node will have a reference to its…

Introduction This is a GoodTecher compiled list. Each question is a typical question for the category it represents. To solve…

Description https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters/ Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping…

Description https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters/ Given a string s, return the number of substrings of length k with no repeated characters. Example 1: Input: s =…

Description https://leetcode.com/problems/rotting-oranges/ You are given an m x n grid where each cell can have one of three values: 0 representing an empty cell,…