Skip to content

Commit ec4f6a1

Browse files
authored
Update CountNumBinaryStrings
1 parent 94cfab0 commit ec4f6a1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

DynamicProgramming/CountNumBinaryStrings

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
package DynamicProgramming;
2+
/*
3+
* here is a important algo in this we have to count
4+
* maximum no. of different binary strings which doesnot have
5+
* consectuive 1s
6+
7+
8+
9+
Test Case:
10+
11+
int n=30;
12+
13+
startAlgo();
14+
System.out.println(numStrIS(n));
15+
System.out.println(endAlgo()+"ms");
16+
17+
startAlgo();
18+
CountNumBinaryStr out=new CountNumBinaryStr();
19+
System.out.println(out.numStrR(n).ans);
20+
System.out.println(endAlgo()+"ms");
21+
22+
startAlgo();
23+
System.out.println(countStrings(n,0));
24+
System.out.println(endAlgo()+"ms");
25+
26+
27+
28+
*/
129
public class CountNumBinaryStr {
230
public static long startTime;
331
public static long endTime;

0 commit comments

Comments
 (0)