Company: Texas

Difficulty: medium

Problem Statement

Maximum Displacement After Command Changes A string contains `S` (move one step forward) and `R` (move one step backward). Change exactly `N` commands, then execute the whole string. A command may be changed more than once, so redundant changes are allowed. Print the maximum absolute displacement from the start. Input A command string, then integer `N`. Output The maximum displacement.

More Texas OA questionsInterview experiences