Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

ShoppingList

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.62 sec, absolute running time: 0.15 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 0,87 sec 
edit mode |  history  | discussion
The shopping list looks like:
1 : comb
2 : toothpaste
3 : soap
4 : milk
5 : cooking oil
6 : fish
7 : lentils
8 : snake gourd
9 : potato
10 : puffed rice
11 : peanut
12 : jaggery

There are 12 elements left.
The list is based on priority of making a visit to the respective shop: first grocery, then kitchem market and finally the street snack vendor.
If the priority were reversed (first go to the snack vendor and finally to the grocery), the list would look like:
12 => jaggery 
11 => peanut 
10 => puffed rice 
9 => potato 
8 => snake gourd 
7 => lentils 
6 => fish 
5 => cooking oil 
4 => milk 
3 => soap 
2 => toothpaste 
1 => comb 
But let's stick to the original list and start our shopping.

 After paying visit to grocery the list looks like:
4 : milk
5 : cooking oil
6 : fish
7 : lentils
8 : snake gourd
9 : potato
10 : puffed rice
11 : peanut
12 : jaggery

There are 9 elements left.
After paying a visit to the vegetable market the list looks like:
10 : puffed rice
11 : peanut
12 : jaggery
There are 3 elements left.

After paying visit to street snack vendor the list looks like:
There are 0 elements left.

    
                
λ
.NET NoSQL database for rapid development