Leaderboard
Showing:
Extract the integers
School Accuracy: 17.98% Submissions: 3808 Points: 0

Given a string, the task is to extract all the integers from it.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
Each test case contains a string S as input.

Output:
For each test case, print all the integers with one space, if the string does not contain any integers, print "No Integers".

Constraints:
1<=T<=100
1<=S<=105

Example:
Input:
3

geeksforgeeks 12 23 practice
1: Prakhar Agrawal, 2: Manish Kumar Rai, 3: Rishabh Gupta
geeksforgeeks

Output:
12 23
1 2 3
No Integers

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Extract the integers

Output Window