Company: Headout_12sep

Difficulty: medium

Problem Statement

Slice master Problem Description You and a group of friends are playing a game called Slice master. You start with a string S , and the goal is to cut it into contiguous parts so that no single letter shows up in two different parts. Once the string is sliced, your score is computed like this: For each part of length X , you will be allotted X 2 points. Work out the lowest score a player can end up with when slicing string S under these rules. Note: Once a letter appears inside a given part, it cannot appear in any other part. For example, if part 1 has letters [a, m, i, g, d] then these letters cannot be present in any other part. Complete the solve() function. This function takes the following argument: S : Represents the string to be sliced. Input format for custom testing: Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code. The first line contains a string S denoting the String to be sliced. Outp

More Headout_12sep OA questionsInterview experiences