Company: Juspay_3july

Difficulty: medium

Problem Statement

Encrypted File Name Update Problem Description A device-management platform tags every firmware build with an obfuscated label made only of lowercase English letters. Whenever a build is rotated to a new label, the replacement must follow strict rules: The replacement label must be exactly k characters long. Every character in the replacement label must already appear somewhere in the original label. The replacement label must be lexicographically greater than the original label, meaning it would sort after the original if the two were placed in alphabetical order. Given the original label, find the lexicographically smallest replacement label of length k that satisfies all three rules. Return "-1" if no such replacement is possible. Note: A string p is lexicographically smaller than string q if p sorts before q in dictionary order. For example, "abc" sorts before "abcd", and "abd" sorts before "abe". Function Description Complete the solve function in the editor below. It has the foll

More Juspay_3july OA questionsInterview experiences