summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--re-id/Solution.java5
-rw-r--r--re-id/constraints.txt21
-rw-r--r--re-id/readme.txt43
-rw-r--r--re-id/solution.py2
4 files changed, 71 insertions, 0 deletions
diff --git a/re-id/Solution.java b/re-id/Solution.java
new file mode 100644
index 0000000..c4e8763
--- /dev/null
+++ b/re-id/Solution.java
@@ -0,0 +1,5 @@
+public​ ​class​ ​Solution{
+​ ​​ ​​ ​​ ​public​ ​static​ ​String​ ​solution(int​ ​i)​ ​{
+​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​//​ ​Your​ ​code​ ​here
+​ ​​ ​​ ​​ ​}
+}
diff --git a/re-id/constraints.txt b/re-id/constraints.txt
new file mode 100644
index 0000000..f201987
--- /dev/null
+++ b/re-id/constraints.txt
@@ -0,0 +1,21 @@
+Java
+====
+Your code will be compiled using standard Java 8. All tests will be run by calling the solution() method inside the Solution class
+
+Execution time is limited.
+
+Wildcard imports and some specific classes are restricted (e.g. java.lang.ClassLoader). You will receive an error when you verify your solution if you have used a blacklisted class.
+
+Third-party libraries, input/output operations, spawning threads or processes and changes to the execution environment are not allowed.
+
+Your solution must be under 32000 characters in length including new lines and and other non-printing characters.
+
+Python
+======
+Your code will run inside a Python 2.7.13 sandbox. All tests will be run by calling the solution() function.
+
+Standard libraries are supported except for bz2, crypt, fcntl, mmap, pwd, pyexpat, select, signal, termios, thread, time, unicodedata, zipimport, zlib.
+
+Input/output operations are not allowed.
+
+Your solution must be under 32000 characters in length including new lines and and other non-printing characters.
diff --git a/re-id/readme.txt b/re-id/readme.txt
new file mode 100644
index 0000000..7cdca71
--- /dev/null
+++ b/re-id/readme.txt
@@ -0,0 +1,43 @@
+Re-ID
+=====
+
+There's some unrest in the minion ranks: minions with ID numbers like "1", "42", and other "good" numbers have been lording it over the poor minions who are stuck with more boring IDs. To quell the unrest, Commander Lambda has tasked you with reassigning everyone new random IDs based on a Completely Foolproof Scheme.
+
+Commander Lambda has concatenated the prime numbers in a single long string: "2357111317192329...". Now every minion must draw a number from a hat. That number is the starting index in that string of primes, and the minion's new ID number will be the next five digits in the string. So if a minion draws "3", their ID number will be "71113".
+
+Help the Commander assign these IDs by writing a function solution(n) which takes in the starting index n of Lambda's string of all primes, and returns the next five digits in the string. Commander Lambda has a lot of minions, so the value of n will always be between 0 and 10000.
+
+Languages
+=========
+
+To provide a Java solution, edit Solution.java
+To provide a Python solution, edit solution.py
+
+Test cases
+==========
+Your code should pass the following test cases.
+Note that it may also be run against hidden test cases not shown here.
+
+-- Java cases --
+Input:
+Solution.solution(0)
+Output:
+ 23571
+
+Input:
+Solution.solution(3)
+Output:
+ 71113
+
+-- Python cases --
+Input:
+solution.solution(0)
+Output:
+ 23571
+
+Input:
+solution.solution(3)
+Output:
+ 71113
+
+Use verify [file] to test your solution and see how it does. When you are finished editing your code, use submit [file] to submit your answer. If your solution passes the test cases, it will be removed from your home folder.
diff --git a/re-id/solution.py b/re-id/solution.py
new file mode 100644
index 0000000..7327302
--- /dev/null
+++ b/re-id/solution.py
@@ -0,0 +1,2 @@
+def​ ​solution(i):
+​ ​​ ​​ ​​ ​#​ ​Your​ ​code​ ​here