Tap here to switch tabs
Problem
Submissions

Problem: Check Good Integer

Check Good Integer asks whether a positive integer is good. The sum of the squares of its digits minus the sum of its digits must be at least 50. Return true or false.

Statement

You are given an integer n.

An integer is considered a good integer if the difference between the sum of the squares of its digits and the sum of its digits is greater than or equal to 5050.

Return true if n is a good integer, and false otherwise.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check Good Integer

Check Good Integer asks whether a positive integer is good. The sum of the squares of its digits minus the sum of its digits must be at least 50. Return true or false.

Statement

You are given an integer n.

An integer is considered a good integer if the difference between the sum of the squares of its digits and the sum of its digits is greater than or equal to 5050.

Return true if n is a good integer, and false otherwise.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9