Company: Intuit
Difficulty: medium
Secure a compromised communication network by disconnecting all nodes. There is a series of nodes represented by lowercase English letters in a string. In a single operation, you can disconnect any number of adjacent nodes that are the same letter. Determine the minimum number of operations required to disconnect all nodes and secure the network. Example series = "aabbaa": The minimum number of operations required is 2: Disconnect the group "bb". Disconnect the remaining group "aaaa". Function Description Complete the function getMinOperations in the editor with the following parameter: string series: a series of nodes Returns int: the minimum number of operations required to delete the entire series Constraints 1 ≤ length of series ≤ 500 It is guaranteed that series contains lowercase English letters only. Sample Case 0 Sample Input For Custom Testing STDIN FUNCTION ----- -------- abaca → series = "abaca" Sample Output 3 Explanation It is optimal to delete the substrings "b