DevJourney · code I wrote while learning

README.md

Number Analyzer

Single File Programming Question

Problem Statement

Jordan is examining a sequence of numbers and wants to find those that are greater than the number formed by reversing their digits.

You are given a list of integers by Jordan. Store them in a file named input.txt, with each number on a separate line.

Your task is to identify and extract the numbers that are greater than their reversed form. Save the valid numbers to a file named output.txt on a single line, separated by spaces.

If no numbers meet the condition, write the message "No numbers found" to the output file.

Input:

format :

First line: An integer n — the total number of integers in the list.

Second line: n space-separated integers.

Output:

format :

A single line with space-separated numbers that are greater than their reverse.

If none are found, print: No numbers found

Refer to the sample output for formatting specifications.

Code constraints : 1 ≤ n ≤ 30

1 ≤ each integer ≤ 1000

Sample test cases :

Input 1:

3
21 798 22
Output 1 :
21
Input 2 :
6
79 21 123 321 100 432
Output 2 :
21 321 100 432
Input 3 :
5
10 2 3 4 5
Output 3 :
10
Input 4 :
3
12 34 56
Output 4 :
No numbers found
Note :
The program will be evaluated only after the “Submit Code” is clicked.
Extra spaces and new line characters in the program output will result in the failure of the test case.
Marks : 10
Negative Marks : 0