you give string s consist n character X OA define select consecutive character s convert O note apply character o stay samereturn minimum number move require character s convert O Example 1input s xxxoutput 1explanation XXX OOOWe select 3 character convert moveExample 2input s XXOXOutput 2explanation XXOX OOOX OOOOWe select 3 character convert OThen select 3 character convert final string contain OsExample 3Input s OOOOOutput 0explanation there Xs s convert Constraints3 slength 1000si x o