You are given a number n. There is an array of strings that contains all the binary strings of length n where each strin
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
You are given a number n. There is an array of strings that contains all the binary strings of length n where each strin
c++
c
python
You are given a number n. There is an array of strings that contains all the binary strings of length n where each string represents the pl antation system where '1' represents plant A and '0' represents plant B. According to research if any two plant A comes together then they will stop the growth of the neighbors also. Your task is to find the nu mber of plantations in which growth will not be affected. Note - Since the answer can be too long, return the answer modulo 1e9+7. Constraints: 1 <= n <= 100000 Input Format The first line contains an integer n. Output Format Print k-the number of strings satisfying the condition.
Output Format Print k-the number of strings satisfying the condition. Sample Testcase #0 Testcase Input 3 Testcase Output LO 5
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { } public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print o }
#include <c<math> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; C++ int main() { /* Enter your code here. Read input from STDIN. Print outp return 0; I }
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { } eme C /* Enter your code here. Read input from STDIN. Print or return 0;