FastPrepMinimum Password Increments
Problems/Minimum Password Increments

Minimum Password Increments

Accenture logoAccenture● EasyINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the two arrays, the rule that values can only go up, the goal of using the fewest moves, and the result when it is impossible. We chose that one move adds 1, and we chose the limits and the examples. Our version is about 88% the same as the reported question.

You are given two integer arrays of equal length:

  • target, the required password.
  • current, the current combination.

In one move, choose one index and increase current[i] by exactly 1. Return the minimum number of moves needed to make current equal to target.

If any target value cannot be reached because its current value is already larger, return -1.

Function

minimumPasswordIncrements(target: int[], current: int[]) → long

Examples

Example 1

target = [4,6,3]current = [1,5,1]return = 6

The required increases are 3, 1, and 2, for a total of 6 moves.

Example 2

target = [2,3]current = [2,3]return = 0

The current combination already equals the password.

Example 3

target = [3,4]current = [5,1]return = -1

The first current value is already greater than its target and values cannot be decreased.

Constraints

  • 1 <= target.length == current.length <= 10^5.
  • 0 <= target[i], current[i] <= 10^9.
  • The answer fits in a signed 64-bit integer.

More Accenture interview questions

  • Nearest Composite NumberOA · Seen Sep 2026
  • Reduce a Number to One DigitOA · Seen Sep 2026
  • Candy DistributionOA · Seen Sep 2026
  • Customers Who Never OrderedOA · Seen Sep 2026
  • Economical TripOA · Seen Sep 2026
  • Coin ChangeOA · Seen Sep 2026
  • Validate Email AddressOA · Seen Sep 2026
  • Closest Rhyming WordOA · Seen Aug 2026
  • Array Leader ElementsOA · Seen Nov 2025
  • Alternating Index Square SumONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Picked Player Who LostSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Server InvestmentRippling · OARippling interview questions
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Next Pascal Row CoefficientIntuit · OAIntuit interview questions
  • Unique Integers That Sum to ZeroNVIDIA · OANVIDIA interview questions
  • Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • Maximum Student-Teacher DistanceChubb · OAChubb interview questions

Accenture interview experiences

  • Accenture New Grad ASE OA Questions: 15 Experiences
All Accenture interview questionsSee Accenture hiring insights
Saved
class Solution {
    public long minimumPasswordIncrements(int[] target, int[] current) {
        // Write your code here.
    }

}
Checking account…