**Compilation/Execution Result:**

Given a string with repeated characters, the task is to complete the function **rearrangeString** which rearrange characters in a string so that no two adjacent characters are same, and returns that transformed string.

**Note :** It may be assumed that the string has only lowercase English alphabets and such transformation is always always possible.

**Input:**

The first line of input contains an integer T denoting the no of T test cases.Then T test cases follow. The only line of every test case consists of String s.

**Output:**

For each test case output in the expected output will be 1 if the string returned by the function is valid else 0.

**Constraints:**

1<=T<=100

1<=|s|<=100

**Example:
Input:**

2

aaabc

aaabb

1

1

Author: saksham seth

Shashank_Pathak | 200 |

surbhi_7 | 168 |

yati493 | 167 |

SANJAY5797 | 164 |

dark_knights | 162 |

surbhi_7 | 556 |

Shashank_Pathak | 556 |

dark_knights | 501 |

Infinty | 341 |

Vasudha Gupta | 308 |

akhayrutdinov | 4156 |

sanjay05 | 3597 |

Quandray | 2778 |

Ibrahim Nash | 2475 |

Michael Riegger | 2280 |