korshunovdv / dynamic_programming

Solving combinatoric task with dynamic programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic programming to combinatorial problems

Problem 1

Given number N. Calculate how many combinations with N signs possible combine from 1 and 0. Constraints:

  • Should always start with 1
  • Avoid two digit 1 in series

Examples:

  • for n = 1, possible only 1 combination - '1'
  • for n = 3, possible 3 combinations - '10', '11'
  • for n = 4, possible 3 combinations - '1000', '1001', '1010'

Problem 2

All the same with problem 1, but you should avoid three digit 1 in series

About

Solving combinatoric task with dynamic programming


Languages

Language:Python 100.0%