Answer the question
In order to leave comments, you need to log in
How to write a function that, for a sorted array of integers, determines whether it contains a given value?
https://ideone.com/432iJ3 I tried in many ways, but since I have been doing c# for 4 days, I don’t have the proper knowledge ....
Answer the question
In order to leave comments, you need to log in
Linq has a Contains() function
var array = new int[] { 0, 1, 2, 3, 4, 5 };
Console.WriteLine(array.Contains(3) ? "Contains" : "Not contains");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question