Back to Browse

LeetCode Solutions | 935 | Knight Dialer

9.6K views
May 26, 2020
19:32

Hi guys! The description of this problem follows. Meanwhile, let's connect and talk more! LinkedIn: http://bit.ly/rahulmanghnani Instagram: https://www.instagram.com/bottledbones/ 0:00 Problem Statement 1:06 Explaining the Approach 12:30 Code A chess knight can move as indicated in the chess diagram below: This time, we place our chess knight on any numbered key of a phone pad (indicated above), and the knight makes N-1 hops. Each hop must be from one key to another numbered key. Each time it lands on a key (including the initial placement of the knight), it presses the number of that key, pressing N digits total. How many distinct numbers can you dial in this manner? Since the answer may be large, output the answer modulo 10^9 + 7.

Download

0 formats

No download links available.

LeetCode Solutions | 935 | Knight Dialer | NatokHD