Round 1
Questions:
-
Given a string of letters, containing both uppercase and lowercase letters, return the number of different characters where all lowercase of that character appear before any uppercase letter.
Example:
Input:aaAbcCABBc
Output:2
(a and b are counted, c is not counted) -
Given 2 balls Red and White, return the minimum number of swaps required where we want to arrange all the red balls into a consistent segment (in one move, you can swap adjacent ones).
Example:
Input:WRRWRW
Output:2
(resulting arrangement:WRRRWW
) -
Given a String S representing positive digits containing n numbers, and given k (number of moves), you can replace any number other than 5, return the maximum number possible within k moves.
Example:
Input:165232
, k=3
Output:565552
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.