Check String
Submissions: 5443   Accuracy:

30.81%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given a string S , write a program to check if all the characters of the string are same or not.

Input:
The first line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a string S.

Output:
For each test case print "YES" without quotes if all the characters of the string S are same otherwise print "NO".

Constraints:
1<=T<=100
1<=length(S)<=104

Example:
Input:

2
geeks
gggg
Output:
NO
YES

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Harsh Agarwal
Author: harsh.agarwal0


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.