Company: sprinklr_21july
Difficulty: medium
Gambler's Dice Problem Description You are given an n-ary perfect tree with k levels. You need to mark each node of this tree with a number on dice such that the resulting tree is Gambler Friendly. A tree is Gambler Friendly if the following holds: For every node of the tree, let's say it is marked with a number p (1 Note: A number is not adjacent to itself on dice. You need to calculate the number of possible ways to paint the tree such that it is Gambler Friendly. Since the number can be very large, print it modulo 10^9 + 7. Note for reference: Following is a perfect binary tree with 4 levels (image not included in HTML output). Input Format: 2 space separated integers, n and k Examples Example 1: Input: 3 3 Output: 100663296 Constraints 2 1 Note Your code must be able to print the sample output from the provided sample input. However, your code is run against multiple hidden test cases. Therefore, your code must pass these hidden test cases to solve the problem statement. Limits Tim