Razorpay Off-Campus OA | Optimal String Partitioning, Chip Packet Selection & LFU Cache

Razorpay · Question · Posted Jun 2026

Problem 1 - Optimal String Partitioning Problem Statement You are given a string S consisting of lowercase English letters. You need to partition the string into one or more contiguous substrings such that every distinct character appears in at most one partition. The score of a partition having length L is defined as: score = L^2 The total score is the sum of the scores of all partitions. Your task is to return the minimum possible total score while satisfying ...

The full answer & interview discussion are available to premium members.

Log in Create a free account