Uniform Strings

All submissions for this problem are available.
You are given a string s of length 8 consisting solely of '0's and '1's. Assume that the characters of the string are written in a circular fashion. You need to find the number of 01 or 10 transitions that one has to make while making a single traversal over the string. ie. start from any character and go circularly until you get back to the same character, and find the number of transitions that you made. The string is said to be said to be uniform if there are at most two such transitions. Otherwise, it is called nonuniform.
Given the string s, tell whether the string is uniform or not.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The only line of input contains the string s.
Output
For each test case, output "uniform" if the given string is uniform and "nonuniform" otherwise.
Constraints
 1 ≤ T ≤ 256
 Length of s is 8
Example
Input 4 00000000 10101010 10000001 10010011 Output uniform nonuniform uniform nonuniform
Explanation
The number of transitions are 0, 8, 2 and 4 for the respective cases. So, the first and third one are uniform while the second and fourth one are nonuniform.
Author:  admin2 
Editorial  https://discuss.codechef.com/problems/STRLBP 
Tags  acm17kgp, admin2, cakewalk, kgp17rol 
Date Added:  8122017 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 