FactSet interview question

String manipulation hackerrank questions involving bits