CONDUENT Hiring | Off Campus OA (2024) | Count Distinct Palindromic Subsequences of Length 3
Question · Posted Jun 2026
Problem Statement You are given a string s consisting of lowercase English letters. A palindromic subsequence of length 3 is a subsequence that: Has exactly three characters. Reads the same forwards and backwards. The first and third characters must be the same. Examples of valid palindromic subsequences: "aba" "aaa" "aca" "bab" Examples of invalid subsequences: "abc" "aab" "cab" Your task is to find the number of distinct palindromic subsequences of length 3 present in the string. Two palindromic subsequences are ...
The full answer & interview discussion are available to premium members.
Log in Create a free account