Color Fence Posts So Neighbours Differ
Asked at Ripple · Coding Questions · Difficulty: Easy
A fence has `n` posts in a row, and each post is painted in one of `k` colors. Two posts that stand next to each other must not have the same color. Count how many different ways there are to paint the whole fence.
Loading the problem…
More Ripple interview questions
- Designing a Scalable News Aggregator System with Cassandra
- Delivery Expense Conversion
- XRP Quote From USD Budget Using Sell Limit Orders (Partial Fills Allowed)
- Food Delivery Platform Management
- Find Path Between Two Nodes in a Binary Tree
- Backpack of Supplies: Prioritize Valuable Items