Minimum Addition to Make Integer Beautiful at Infosys

Medium38.5% acceptance

This problem has 75.0% frequency at Infosys.

Problem Description

You are given two positive integers `n` and `target`. An integer is considered **beautiful** if the sum of its digits is less than or equal to `target`. Return the _minimum**non-negative** integer _`x` _such that_`n + x` _is beautiful_. The input will be generated such that it is always possible t...

Read full problem and hints

Topics

Also asked at 2 companies


More Infosys Questions

View all Infosys questions