Modeling this problem to unique string permutations problem

  • 0

    First of all, IMO I don't think this problem should be easy, it should be medium, anyways.

    This problem could be modeled to getting all unique permutations of a string. There's a more efficient solution for this problem than the regular backtracking algorithm using hashmap to count the frequencies of each occurrence of an element.

    For example if n = 2, then we have the input as 0000000011, we run the string permutation algorithm that generate all the unique permutations of this string, then we get the time representation.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.