All Questions
2 questions
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> ...
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 ...