Skip to content

Latest commit

 

History

History

Java Substring

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Java HackerRank

Difficulty Max Score Success Ratio
Easy 5 98.99%

Given a string, [SVG image] , and two indices, [SVG image] and [SVG image] , print a substring consisting of all characters in the inclusive range from [SVG image] to [SVG image] . You'll find the String class' substring method helpful in completing this challenge.

Input Format

The first line contains a single string denoting [SVG image] .

The second line contains two space-separated integers denoting the respective values of [SVG image] and [SVG image] .

Constraints

  • [SVG image]
  • [SVG image]
  • String [SVG image] consists of English alphabetic letters (i.e., [SVG image] ) only. Output Format

Print the substring in the inclusive range from [SVG image] to [SVG image] .

Sample Input

Helloworld
3 7

Sample Output

lowo

Explanation

In the diagram below, the substring is highlighted in green:

substring.png

💡 Hints

➡️ Approach

✅ Detailed Solution

View Solution : Java Substring

Submissions Leaderboard Discussions Editorial
📝 My Submission 🏆 Track our position 🤔 Help from Community ✍️ Editorial