Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- public class Search_for_a_Number
- {
- public static void Main()
- {
- List<int> list = Console.ReadLine()
- .Split().Select(int.Parse).ToList();
- int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int take = input[0];
- int delete = input[1];
- int present = input[2];
- List<int> newList = list.Take(take).ToList();
- newList.RemoveRange(0,delete);
- if(newList.Exists(x => x == present))
- {
- Console.WriteLine("YES!");
- }
- else
- {
- Console.WriteLine("NO!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement