7

PROBLEM OF THE DAY : 04/12/2023 | Sum-string

 9 months ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-04122023-sum-string/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PROBLEM OF THE DAY : 04/12/2023

December 05, 2023 |2.0K Views
PROBLEM OF THE DAY : 04/12/2023 | Sum-string
Problem of the Day, String, Data Structure and Algorithm
 Save  Share  3 Likes
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Devashish Khare. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Strings but also build up problem-solving skills.

In this problem, we are given, a string of digits, the task is to check if it is a ‘sum-string’. A string S is called a sum-string when it is broken down into more than one substring and the rightmost substring can be written as a sum of two substrings before it and the same is recursively true for substrings before it.

Example :

Input:
S = "12243660"
Output:
1

Explanation:
"12243660" can be broken down as {"12", "24", "36", "60"}. We can get 60 from 24 and 36 as 24 + 36 = 60. Similarly 36 can be written as 12 + 24.

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/sum-string3151/1

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK