Same Characters

Start Timer

0:00:00

Upvote
8
Downvote
Save question
Mark as completed
View comments (18)

Given a list of strings, write a Python program to check whether each string has all the same characters or not. What is the complexity of this program?

Example

Input:

string_list = ['bbbbb', 'abc', 'aaaaaaaab']

Output:

def same_characters(input_list) -> False

Explanation:

  • string bbbbb has all the same characters
  • string abc does not have all the same characters
  • string aaaaaaaab does not have all the same characters
.
.
.
.
.


Comments

Loading comments