Jobra drops you into a broken repo. Find it, fix it, ship it. AI helps you debug like on the job.
Jobra drops you into a broken repo. Find it, fix it, ship it. AI helps you debug like on the job.
Mode: On-Campus OA Date: 2026-11-24
You are given a string S consisting of only two characters: R and L.
R represents a move one step to the right (+1).L represents a move one step to the left (-1).You are also given three integers: N, X, and Y.
Consider a number line containing all integers from 0 to N (both inclusive). You start at position X and need to reach position Y.
Your task is to find the number of distinct subsequences of string S that can take you from position X to position Y.
Rules:
[0, N].Important: If the string S contains multiple occurrences of the same subsequence, count it only once.
For example, if RR can be obtained using different sets of indices, it must still be counted as only one distinct subsequence.
Return the total number of distinct subsequences that take you from X to Y.
HPE • 115 views
HPE • 302 views