Q1: How many sets are possible from an array of size n, such that each number in the set divides the consecutive number in the set. You can use one value only once in a particular set.
Approach: Sort the input array, Iterate in the input array and iterate through the divisors of A[i] and add the dp[divsors] to dp[A[i]]
Edge Case: When the array contains zero, do not iterate through zeros and answer will be 2*ans+1
Q2: Given a tree. A signal starts at the root at time t=0, at every second each node which has the signal can pass it to one of its children and the signal persists, calculate the minimum time such that all nodes in the tree will have the signal.
Approach: Can be solved with dfs+dp, if the answers to all the children of a node are sorted in descending order, the answer to the node will be maximum of (ans[child]+i+1, ans[node]), where i is the index of the child, and the answer for the leaf node will be 1 as a base case.
- Nutanix Interview Experiance - Campus Placements
- Codenation Interview Experience
- Codenation Interview Experience | Set 2 (On-Campus for Internship)
- Codenation Interview Experience | Set 3 (Off-Campus for SDE)
- Codenation Interview Experience | Set 4 (Off-Campus for Internship)
- Codenation Interview Experience (On Campus for Internship)
- Codenation Interview Experience | Set 3 (SDE)
- CodeNation Interview Experience | (On-Campus for SDE)
- Codenation Interview Experience (2020 Graduate)
- CodeNation Interview Experience (Full-Time SDE, Off-Campus)
- Codenation Interview Experience | On campus for Internship
- Codenation Interview Experience for SDE-1 (On-Campus)
- Codenation Interview Experience | Online Test
- Codenation Recruitment Process
- Amazon Interview | Set 40 (On-Campus Round 1)
- Tower Research LLC Interview Experience | Set 1 (Telephonic Round for Internship)
- Amazon Interview Experience | Set 177 (First Round in Pool Campus)
- D E Shaw Interview | Set 8 (Telephonic Round Questions)
- Cigital Interview Experience (Coding Test Round 1)
- Directi Interview Experience | Set 15 (1st Round of On-Campus)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.