Your question is Prime Numbers and String-to-Int. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A Cornerstone OnDemand service receives a maximum employee ID and a configuration value as text. Implement one function that generates every prime number up to the maximum ID and converts the configuration string to a 32-bit signed integer without using library conversion or prime-generation functions.
Implement find_primes_and_parse(n, s):
[2, n] in ascending order using the Sieve of Eratosthenes.s manually. Ignore leading ASCII spaces, accept one optional + or -, consume consecutive decimal digits, and stop at the first non-digit after digits begin.0 if no digits are found.-2147483648 or 2147483647.int(), float(), str.strip(), str.isdigit(), regular expressions, or library prime utilities.Return a dictionary with keys primes and value.
def find_primes_and_parse(n, s):