#C11765. Remove All Instances

    ID: 41117 Type: Default 1000ms 256MiB

Remove All Instances

Remove All Instances

You are given a list of integers and an integer \(n\). Your task is to remove all occurrences of \(n\) from the list while maintaining the order of the remaining elements.

For example, if \(L = [1, 2, 3, 3, 3, 4]\) and \(n = 3\), then the resulting list should be \([1, 2, 4]\).

inputFormat

The input consists of two lines. The first line contains two integers: (m) (the number of elements in the list) and (n) (the integer to remove). The second line contains (m) space-separated integers. If (m = 0), the second line will be empty.

outputFormat

Output the list after removing every occurrence of (n). Print the numbers in their original order, separated by a single space on one line. If the resulting list is empty, output an empty line.## sample

4 5
1 2 3 4
1 2 3 4

</p>