Use streams to process a list of items to process and output how many of each item is needed. public Map

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Use streams to process a list of items to process and output how many of each item is needed. public Map

Post by answerhappygod »

Use streams to process a list of items to process and output howmany of each item is needed.
publicMap<String,List<String>>createItemMap(Map<String,List<String>> orderMap)
/*OrderID,List of items
eg : 1000 - milk, egg
1002 -milk, bread
1003 -bread, apple
1004 -apple,orange,egg
Result
item, List of orders
milk - 1000,1002
egg - 1000,1004
bread - 1002,1003
apple - 1003,1004
orange - 1004
*/
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply