← OYO questions

Smallest number with given digit sum and sum of squares

Filed under OYO

Find the smallest positive integer with a digit sum of 'a' and a sum of squared digits of 'b'. The total number of digits must not exceed 100; return -1 if impossible.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related OYO questions

Collected from public candidate posts and coding forums. Updated Nov 2026.