Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
3 answers
484 views

Best way to replace multiple FOR loops with stream api in Java

I want to make this function run is less time. I am assuming stream() might help. But not sure how. private List<TodayMenu> getRecommendedTodayMenuItems(Map<String, Integer> ...
Vishal Anand's user avatar
1 vote
1 answer
117 views

Adding an element before particular value in an array

I need to add an element before every occurrence of a particular element. I can do this using for loop and calculate the index and then add the element. Is there any efficient method without using for ...
Bhanu's user avatar
  • 223