Company: amdocs_31oct
Difficulty: medium
Strange Printer Problem Description Given a printer with the following attributes: The printer can only type a sequence of the same character each time. At each turn, the printer can print new characters starting from and ending at any place and will cover the original existing characters. Given a string s , return the minimum number of turns the printer needed to print it. Note: The printer cannot print whitespaces between the characters it prints during a turn. Examples Example 1: Input: s = "aaabbb" Output: 2 Explanation: Print "aaa" first and then print "bbb". Example 2: Input: s = "aba" Output: 2 Explanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'.