Remove isolated elements of a vector Languages

Remove isolated elements of a vector

I have a vector of integers and I want to filter it by eliminating the components that are "isolated". What do I mean by "isolated"? those components that does not lie in an 4-neighbourhood of other component. The components in the vector are ordered increasingly, and there are no repetitions.
Read More
Redundant 'if' statement less Languages

Redundant 'if' statement less

My code is as belowThe compiler tell meRedundant 'if' statement less... (Ctrl+F1) This inspection reports if statements which can be simplified to single statements. For example: if (foo()) { return true } else { return false } can be simplified to return foo().
Read More