Challenge You are painting post on a fence of size N.
Only K consecutive post can have the same color.
Return the number of way you can paint the fence.
E.g:
N = 3 K = 2 -> will return 6 Solution 1 - Time Limted Exceeded class Solution: def helper(self,n, k, fence) ->int: if len(fence) >= 3 and fence[-3] == fence[-2] == fence[-1]: return if len(fence) == n: self....
Algo I realized, most of the time, I’m not able to find back my answers from previous coding challenges.
I can remember a similar problem or want to have a quick reminder about something and I can’t find it…
With this blog, I’m hoping that it will change, I’ll try to keep things nice and tidy.
I used to post them on www.blog.nolanemirot.com but I feel it’s more convenient to have another blog for that....