Problem description: Visit and Support LeetCode Search via Difficulty: Hard Tags: LeetCode, Math, O(n^2), O(n), Hard ProblemSolutionCodeProblem