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.
Extremum Permutations
Extremum Permutations
Sort by
recency
|
16 Discussions
|
Please Login in order to post a comment
include
include
include
include
include
include
include
include
include
include
char* readline(); char* ltrim(char*); char* rtrim(char*); char** split_string(char*);
int parse_int(char*);
/* * Complete the 'extremumPermutations' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. INTEGER n * 2. INTEGER_ARRAY a * 3. INTEGER_ARRAY b */
int extremumPermutations(int n, int a_count, int* a, int b_count, int* b) {
}
int main() { FILE* fptr = fopen(getenv("OUTPUT_PATH"), "w");
}
char* readline() { size_t alloc_length = 1024; size_t data_length = 0;
}
char* ltrim(char* str) { if (!str) { return '\0'; }
}
char* rtrim(char* str) { if (!str) { return '\0'; }
}
char** split_string(char* str) { char** splits = NULL; char* token = strtok(str, " ");
}
int parse_int(char* str) { char* endptr; int value = strtol(str, &endptr, 10);
}
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Extremum Permutations Solution
Here is Extremum Permutations problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-extremum-permutations-problem-solution.html
My code generates permutations in a recursive way. While a new element is being added to the current permutation, my code checks whether it complients or not to the rules. As far 4 testcases are green, the others got timeout. I don't know how could I fast up my solution. As I see I cannot share my solution here anymore. There is some regulation here.