3959. Check Good Integer
LeetCodeOpen on judge ↗
You are given a positive integer n. Let digitSum be the sum of the digits of n, and let squareSum be the sum of the squares of the digits of n. An integer is called good if squareSum - digitSum >= 50. Return true if n is good. Otherwise, return false. Example 1: Input: n = 1000 Output: false Explanation: - The digits of 1000 are 1, 0, 0, and 0. - The digitSum is 1 + 0 + 0 + 0 = 1. - Th
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start