Cut #1 HackerRank Solution

Hello coders, In this post, you will learn how to solve the Cut #1 HackerRank Solution. This problem is a part of the Linux Shell series.

Cut #1 HackerRank Solution
Cut #1 HackerRank Solution

Cut #1 HackerRank Solution:-

Problem

Given N lines of input, print the 3rd character from each line as a new line of output. It is guaranteed that each of the n lines of input will have a 3rd character.

Input Format

A text file containing N lines of ASCII characters.

Constraints

  • 1 <= N <= 100

Output Format

For each line of input, print its 3rd character on a new line for a total of N lines of output.

Sample Input

Hello
World
how are you

Sample Output

l
r
w

Cut #1 HackerRank Solution

# print the 3rd character from each line as a new line of output.
cut -c 3

Note: This problem (Cut #1) is generated by HackerRank but the Solution is provided by chase2learn. This tutorial is only for Learning and Educational purpose.

Leave a Comment