We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Alternating Characters
- Discussions
Alternating Characters
Alternating Characters
Sort by
recency
|
1968 Discussions
|
Please Login in order to post a comment
def alternatingCharacters(s):
Here are my c++ approaches of solving this, video explanation here : https://youtu.be/KoDlxS38_ig
Solution 1 : Using loop
Solution 2 : Using regex
Here is my one line Python solution!
PYTHON CODE
python MyAnswer
def alternatingCharacters(s): i=0 j=1 count=0 while i