Pergunta de entrevista da empresa Philips

Given a string reverse only the alphabets while leaving special characters in the same place.

Resposta da entrevista

Sigiloso

15 de jun. de 2018

Step1:Split the string into an array of characters Step2:Create three arrays one marking the indexes as 1 for alphabet and 0 for spec. chars. Another array with all alphabets and one more array containing spec. chars Step 3: reverse the array with alphabets Step 4:Now compile the output with the index ,spec.char and reverse alphaet arrays