Samsung R&D OA 2023 | DP & Strings | String Partitioning

Samsung · Question · Posted Jun 2026

Question 1: String Partitioning Problem Statement You are given a string S of length N and a list L of length K containing substrings of S. Find the total number of ways in which the string S can be partitioned such that each partition contains a string from the list L. You must also find the minimum number of partitions (cuts) that have to be made in S to satisfy that condition. Input Format The first line of input contains ...

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

Log in Create a free account