1)
You need to prepare food, for that you have a set of ingredients available. Each ingredient has its own health value. You need to write a code which can determine all possible combinations of ingredients whose sum of total health is highest in the end. The number of ingredients in any combination can be 3 ingredients. Given below is the list with ingredient and their health value.
Salt -1
Sugar +1
Onion +2
Tomato +1
Spinach +3
Oreo -2
For example: Spinach (+3), Onion (+2), Sugar(+1) have a total health value of 6 and number of ingredients are 3. Like this your program should find best combinations (print the 3 best ingredients).
**2)**You need to find smallest positive integer which has certain digits on a condition that if this integer is multiplied by 2,3,4,5 or 6, the answers will still have same digits.
For example: 125874 when multiplied by 2 gives 251748. Both numbers have same digits, i.e. 1, 2, 4, 5, 7 and 8
3)
Given two arrays of length n and n-1, all elements of both the arrays are same except one. Find the odd element out, giving O (1) solution.
Given two binary trees (not any special tree like binary search tree or red black tree) with n and n-1 nodes respectively, find the odd node out.
Given two binary search trees with n and n-1 nodes respectively with all elements same except one, find the odd node.
Given an array where each element signifies the number of cells which can be skipped, find the minimum number of steps taken to reach the last cell of the array. One has to start at index 0 and always move forward either by skipping cells by number given or by one.