FastPrepSingle-Digit Addition Equation Repairs
Problems/Single-Digit Addition Equation Repairs

Single-Digit Addition Equation Repairs

ZipRecruiter logoZipRecruiter● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA report describes nonzero digits, exactly one substitution in exactly one number, a nonzero replacement, counting equations, and 7+1=7 giving 2. We supplied limits and a string input.

a, b, and c are positive decimal strings containing no zero digits. Change exactly one digit in exactly one input to a different digit from 1 through 9.

Count substitutions after which a + b = c.

Function

countEquationRepairs(a: String, b: String, c: String) → int

Examples

Example 1

a = "7"b = "1"c = "7"return = 2

Changing b to 0 is forbidden; the two valid nonzero repairs satisfy the equation.

Example 2

a = "1"b = "1"c = "2"return = 0

The equation is already true, but exactly one different digit must be changed.

Constraints

  • 1 <= a.length,b.length,c.length <= 15

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Basic Calculator IITypeSafe AI · OA
  • Perfect Squares Matching a PatternNielsen · OA
  • Simplify a Quadratic ExpressionOpenAI · OAOpenAI interview questions
  • Next Number with Disjoint DigitsElevenLabs · OAElevenLabs interview questions
  • Vowel Substring GameAkuna Capital · OAAkuna Capital interview questions
  • Minimum Anagram PeriodVisa · OAVisa interview questions
  • Return Exact Cash Register ChangeBank of America · OABank of America interview questions
  • Maximum Equal Parts for PrefixesAmazon · OA
  • Minimum Anagram PeriodWells Fargo · OAWells Fargo interview questions
  • Minimum Digit Swaps for the Smallest DifferenceLSEG · OALSEG interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int countEquationRepairs(String a, String b, String c) {
        // Write your code here.
    }

}
Checking account…