Pergunta de entrevista da empresa Hudson River Trading

Write an algorithm that returns if a string can be partitioned into k sized intervals with each k containing a specific amount of 1's (the string is binary).