Microsoft OA | SDE 2 | Redmond
Anonymous User
447

Giving back to the community
Microsot OTA Questions
3 questions, 60 min time limit on Codelitiy

Q1) Given a string of letters, continaing both uppercase and lowercase letters, return the number of different characters where all lowercase of that charecter appear before any uppercase letter

Ex : aaAbcCABBc
Here the output is 2, a and b, c is not counted

Q2) Given 2 balls Red and White, return the minum number of swaps required where we want to arrange all the red balls into consistent segment ( in one move, you can swap adjacent ones)

Ex: WRRWRW
out: WRRRWW, function returns 2

Q3) Given a String S representing positive digit containing n numbers, and given k ( number of moves), you can replace any number other then 5, return the maximun number possible within k moves

Ex: 165232, k=3 output: 565552

Could'nt solve the third one, as i ran out of time.

Comments (5)