Answer: 4. ABB INDIA Hiring | Off-Campus OA (2025) | Count Symmetric Integers

Answer · Posted Jun 2026

Approach Traverse every number from low to high. Ignore numbers with an odd number of digits. Split the digits into two halves. Compare the digit sums of both halves. Count valid symmetric integers. Strategy Convert each number into a string. Skip odd-length strings. Compute the sum of both halves. Increase the answer if both sums are equal. Java Code class Solution { public int countSymmetricIntegers(int low, int high) { int count = 0; for (int num = low; num <= ...

The full answer & interview discussion are available to premium members.

Log in Create a free account