problem267

package
v1.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 0 Imported by: 0

README

< Previous                  Next >

267. Palindrome Permutation II (Medium)

Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form.

Example 1:

Input: "aabb"
Output: ["abba", "baab"]

Example 2:

Input: "abc"
Output: []

[Backtracking]

Similar Questions

  1. Next Permutation (Medium)
  2. Permutations II (Medium)
  3. Palindrome Permutation (Easy)

Hints

Hint 1 If a palindromic permutation exists, we just need to generate the first half of the string.
Hint 2 To generate all distinct permutations of a (half of) string, use a similar approach from: Permutations II or Next Permutation.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL