Company: Makemytrip_3aug
Difficulty: medium
Symmetric Round-Trip Itinerary Problem Description An airline planner has an itinerary: a sequence of N airport codes joined by hyphens, for example SFO-LAX-SEA-LAX-SFO-BOS . Every airport code is exactly three uppercase letters. A subsequence of the itinerary is obtained by deleting zero or more airport codes without changing the order of the remaining codes. The planner wants the largest symmetric round-trip segment : the longest subsequence of airport codes that reads the same forwards and backwards (a palindromic subsequence of codes). Print the number of airport codes in that longest palindromic subsequence. Input Format Read from standard input. CODE1-CODE2-...-CODEN A single line containing the itinerary: N airport codes joined by single hyphens - , with no spaces and no quotes. Output Format Print a single integer: the length of the longest palindromic subsequence, counted in airport codes. Constraints 1 <= N <= 4000 Every airport code is exactly 3 uppercase English lette