
You are given a list of college students. Each student is represented by a set of attributes: a unique integer ID, a string name, and a string branch.
Your task is to write a program that filters this list and creates a new, separate list containing only the students whose branch is exactly "Mechanical".
The students in the returned list should maintain their relative order from the original list.
The first line contains a single integer N, the total number of students.
The next N lines each contain the details of one student in a comma-separated format: ID,Name,Branch.
For each student in the filtered "Mechanical" list, print their details on a new line in the format: ID: [id], Name: [name], Branch: [branch].
If no students are found in the "Mechanical" branch, print a single line: No students found in the Mechanical branch.
The branch name matching is case-sensitive. For example, "mechanical" would not be considered a match for "Mechanical".
4
101,John Doe,CSE
102,Jane Smith,Mechanical
103,Peter Jones,EEE
104,Mary Miller,Mechanical
ID: 102, Name: Jane Smith, Branch: Mechanical
ID: 104, Name: Mary Miller, Branch: Mechanical
The program iterates through the four students. It finds that Jane Smith (ID 102) and Mary Miller (ID 104) belong to the "Mechanical" branch and adds them to the new list, preserving their original order.
3
201,Alice,CSE
202,Bob,EEE
203,Charlie,IT
No students found in the Mechanical branch.
None of the students in the input list belong to the "Mechanical" branch, so the program outputs the corresponding message.
The expected time complexity is O(N).
0 <= N <= 1000
1 <= ID <= 10^5
1 <= length of Name, Branch <= 50
Student names can contain spaces.