Company: Kickdrum_24sep
Difficulty: medium
Kickdrum Problem Description You are designing command sequences for a robot. The robot understands three types of basic command strings: 'LL' - light movement (x of these available) 'RR' - rapid movement (y of these available) 'LR' - light followed by rapid (z of these available) You may choose to use any number of these commands (including none), in any order, to form a longer command chain. However, the resulting command sequence must not contain 'LLL' or 'RRR' as a substring (i.e., three consecutive LLs or RRs is forbidden). Your task is to return the maximum possible length of the command sequence (in characters) that can be formed without violating the above rule. Input Format x: number of "LL" commands available y: number of "RR" commands available z: number of "LR" commands available Output Format An integer: the maximum total number of characters in a valid command chain Constraints 1 <= x, y, z <= 50 Examples Example 1: Input: x = 2, y = 5, z = 1 Output: 12 Explanation: