Felix Halim .NET  
Google 

Problem Statement

A palindrome is a string that reads the same forward and backward. The PalMeasure of a string is the sum of the lengths of its substrings that are palindromes. Return the PalMeasure of the concatenation of all the strings in the String[] text.

Definition

Class:              PalindromesAnalyzer
Method:             summaryLength
Parameters:         String[]
Returns:            long
Method signature:	long summaryLength(String[] text)
(be sure your method is public)

Notes

  • A substring is a sequence of consecutive characters from a string.
  • An entire string counts as a substring of itself.
  • Count equal substrings which have different positions as different. For example, if text = {"AAA"}, return 10.

Constraints

  • text will contain between 1 and 50 elements, inclusive.
  • Each element of text will contain only uppercase letters ('A'-'Z').
  • Each element of text will contain between 1 and 50 characters, inclusive.

Examples

0)

{"AAA"}
Returns: 10

1)

{"AB"}
Returns: 2

2)

{"AB", "BA"}
Returns: 10

3)

{"AB", "AAA"}
Returns: 15

4)

{"AZ", "ZZ", "A"}
Returns: 17

This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.


Google India Code Jam 2006 - Table of Contents

  1. Main Page - Google India Code Jam 2006
  2. Qualification Round
  3. Elimination Round
  4. Championship Round
  5. Links/Blogs/News

© Felix Halim 2009 (Loaded in 0.11428 secs)