We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Bear and Steady Gene
- Discussions
Bear and Steady Gene
Bear and Steady Gene
Sort by
recency
|
167 Discussions
|
Please Login in order to post a comment
In my code, I thought of simply finding the position at which the number of gene characters exceeds the limit. I do it from both front and back side then find the length of part of DNA which is to be removed. I find nothing wrong with my logic but the code still doesn't work. What am i doing wrong?
include
using namespace std;
string ltrim(const string &); string rtrim(const string &);
/* * Complete the 'steadyGene' function below. * * The function is expected to return an INTEGER. * The function accepts STRING gene as parameter. */
int steadyGene(string gene) {
}
int main() { ofstream fout(getenv("OUTPUT_PATH"));
}
string ltrim(const string &str) { string s(str);
}
string rtrim(const string &str) { string s(str);
}
Simple Binary Search on Answer with Prefix sum TC : O(nlogn)
java :
public static int steadyGene(String s) { // Write your code here int n=s.length();
hey can someone help me out with this problem? im new to competitive programming and my friend sent me this. he wants me to solve it but as i said, im still new so can yall teach me? here is the problem https://www.hackerrank.com/newbie-challenge
Python 3: