#K83252. Count Palindromic Strings

    ID: 36156 Type: Default 1000ms 256MiB

Count Palindromic Strings

Count Palindromic Strings

You are given T test case(s). For each test case, the first line contains an integer N specifying the number of strings. The following N lines each contain a single string. Your task is to count how many of these strings are palindromic.

A string \( s \) is considered a palindrome if it is equal to its reverse, i.e. \( s = \text{reverse}(s) \). Note that an empty string is also considered a palindrome.

For each test case, output one line containing the count of palindromic strings.

inputFormat

The input is given via standard input (stdin) with the following format:

T
N
s_1
s_2
... 
 s_N
[repeat for each test case]

Where:

  • T is the number of test cases.
  • For each test case, the first line contains an integer N, the number of strings.
  • The next N lines each contain a string s_i.

outputFormat

For each test case, output a single integer on a new line indicating the number of palindromic strings found among the given strings.

## sample
1
1
madam
1

</p>