Question
Download Solution PDFThe number of substrings that can be formed from string given by “a d e f b g h n m p” is
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFConcepts:
A substring is a contiguous sequence of characters within a string.
Example:
String: “GATE”
Substring: G, A, T, E, GA, AT, TE, GAT, ATE, GATE and Λ (empty string or null string)
Therefore, number of substrings = 11
Formula:
If character is not repeated, then
\({\rm{number\;of\;substring}} = \frac{{{\rm{n}} \times \left( {{\rm{n}} + 1} \right)}}{2} + 1\)
Calculation:
String: “a d e f b g h n m p”
∴ number of characters = n = 10
Repetition is not present in a string
\({\rm{number\;of\;substring}} = \frac{{10 \times \left( {10 + 1} \right)}}{2} + 1 = 56\;\)
Last updated on Jun 6, 2025
-> The UGC NET Exam Schedule 2025 for June has been released on its official website.
-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.
-> The UGC NET 2025 online application form submission closed on 12th May 2025.
-> The June 2025 Exam will be conducted from 21st June to 30th June 2025
-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.
-> The exam is conducted bi-annually - in June and December cycles.
-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions.
-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.