5 kyu

The Bee

152 of 274EgorArh

Description:

Imagine a honeycomb - a field of hexagonal cells with side N. There is a bee in the top left cell A. In one move it can crawl one cell down, one cell down-right or one cell up-right (the bee does not crawl up or left).

Write a function that outputs the number of ways the bee can crawl from cell A to the opposite cell B.

Input data:

The function receives a single number N - the size of the hexagonal field 2 ≤ N ≤ 200.

Output data:

The function should output a single integer - the number of ways.

Example:

the_bee(2) --> 11
the_bee(3) --> 291
the_bee(5) --> 259123

Code length limit:

To prevent hardcoding, your code cannot exceed 1 000 characters.

If you have the desire and time, I would be very grateful if you can help in the development of this kata, to translate, or whatever else. I can be contacted via Telegram.

If you want to solve our problems, they are here: From Singularity Hub Community

Algorithms
Mathematics
Matrix
Puzzles
Performance
Dynamic Programming

More By Author:

Check out these other kata created by EgorArh

Stats:

CreatedMar 8, 2023
PublishedMar 8, 2023
Warriors Trained2325
Total Skips72
Total Code Submissions1851
Total Times Completed274
Python Completions152
JavaScript Completions57
C# Completions41
Haskell Completions18
Factor Completions2
Java Completions33
Total Stars109
% of votes with a positive feedback rating92% of 73
Total "Very Satisfied" Votes64
Total "Somewhat Satisfied" Votes6
Total "Not Satisfied" Votes3
Total Rank Assessments8
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • EgorArh Avatar
  • JohanWiltink Avatar
  • Madjosz Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • TheFimerCode Avatar
Ad