Question DSA-STR-0054
MediumHow many substrings (including the full string, excluding the empty one) does a string of length n have?
- A.
2ⁿ
- B.
n²
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Strings question
How many substrings (including the full string, excluding the empty one) does a string of length n have?
2ⁿ
n²
Sign up free to see the answer and a step-by-step explanation.
n(n + 1)/2
n!