RELIANCE JIO Hiring | On Campus OA (2024) | Optimal Partition of String

Question · Posted Jun 2026

Problem Statement You are given a string s consisting of lowercase English letters. Partition the string into the minimum number of substrings such that each substring contains only unique characters (no character appears more than once within the same substring). Return the minimum number of partitions required. A partition divides the string into contiguous substrings, and every character must belong to exactly one partition. Example 1 Input s = "abacaba" Output 4 Explanation One optimal partition is: "ab" | "ac" ...

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

Log in Create a free account