×

# Substring Query

 0 SUBQUERY I am trying to solve this problem but I have a confusion regarding substrings to consider. For example, if string is aabbcccaabbbccc and we want to count the number of substrings of length=2 that occur P=2 times. Should we consider bb and cc in the count? asked 29 Jul '17, 10:46 1●1 accept rate: 0%

 0 I dont think so. Considering two substrings same if and only if both their starting and ending indices are same, I will say "bb" occurs 2 times in "bbb" as a substring and 1 more time at start, so it occurs for a total of 3 times. answered 29 Jul '17, 10:54 15.5k●1●20●66 accept rate: 18% But I checked successful solution for the input aabbcccaabbbccc 1 2 2 The output is 3 (29 Jul '17, 12:11) I think this Q is taking things this way, "aa" "aa" is first 1, then "bb" and first 2 b's in "bbb" as 2nd substring, (i.e. breaking "bbb" as "bb"[this substring is counted] +"b") and so on. But i myself kind of disagree with this. I hope someone else is able to help you better :) (29 Jul '17, 12:48)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×643
×38

question asked: 29 Jul '17, 10:46

question was seen: 436 times

last updated: 29 Jul '17, 13:16