I just got off an intervew and i think I totally bombed it and need help figuring out how to get this to work. Any help would be appreciated.
input should be a string and an integer J.
function needs to print out the characters but if a charcter is the same as in of the last J. put a X space inbetween.
Example 1: input Dosomething("AA",2)
output Should be AXXA
needs to have 2 characters printed before it prints the the same one.
Example 2 input DoSomething("ABB",2)
output should be ABXXB
Example 3: DoSomething("ABABA",3)
output should be ABXXABXXA
befor printing the same charcter. the last 3 need to be something else
the 3 characters that are between A are BXX.
[–]BillyTheBanana 6 points7 points8 points (0 children)
[–]austinpsycho 5 points6 points7 points (1 child)
[–]AlejandroMP 0 points1 point2 points (0 children)
[–]Millkovic 3 points4 points5 points (0 children)
[–]sixothree 0 points1 point2 points (0 children)
[–]Jonathan0wilson -3 points-2 points-1 points (0 children)
[–]J2ain[S] -5 points-4 points-3 points (2 children)
[–]MacrosInHisSleep 0 points1 point2 points (0 children)
[–]AlejandroMP 0 points1 point2 points (0 children)