I have a 2 dimensional array int[][] data and i want to see if the value contains the value 45 for example
I created this line of code
bool contains = data.Where(x => x.Contains(45)).ToArray().Count() != 0 ? true : false;
but it looks like there is unnecessary code and I am sure that there is an easier or more efficient way to do this
.ToArray().Count() != 0can be replaced by.Any(), but more importantly we can't guess what does make you happy. Please read How to Ask and try to edit this into an actually answerable question, and share your research.