Tap here to switch tabs
Problem
Submissions

Problem: Lexicographically Smallest Permutation Above Target

Try to solve the Lexicographically Smallest Permutation Above Target problem.

Statement

You are given two strings s and target of equal length.

Return the lexicographically smallest permutation of s that is strictly greater than target. If no such permutation exists, return an empty string "".

Constraints:

  • 1≤1 \leq s.length == target.length ≤300\leq 300

  • s and target consist only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Lexicographically Smallest Permutation Above Target

Try to solve the Lexicographically Smallest Permutation Above Target problem.

Statement

You are given two strings s and target of equal length.

Return the lexicographically smallest permutation of s that is strictly greater than target. If no such permutation exists, return an empty string "".

Constraints:

  • 1≤1 \leq s.length == target.length ≤300\leq 300

  • s and target consist only of lowercase English letters.