Codebrahma interview question

implement toggle state and show box based on state value