I have tried few web hosting companies having limitation on CPU of using 100% of 1 CPU core (2GHZ mostly), 1Gb ram and 20 entey pr… | Read the rest of http://www.webhostingtalk.com/showthread.php?t=1743355&goto=newpost
I keep getting a error saying cannot download not enough space. But according to my phone I have 429MB and the file I want downloaded is only 40.08MB. I don’t want to use my SD card because the file will be deleted later but, it’s needed now. What should I do?
this is my first post on code review and the problem i am having is that this code passes the tests but it is not fast enough
here is the description with an example
The master launch sequence consists of several independent sequences for different systems. Your goal is to verify that all the individual system sequences are in strictly increasing order. In other words, for any two elements i and j (i < j) of the master launch sequence that belong to the same system (having systemNames[i] = systemNames[j]), their values should be in strictly increasing order (i.e. stepNumbers[i] < stepNumbers[j]).
For systemNames = [“stage_1”, “stage_2”, “dragon”, “stage_1”, “stage_2”, “dragon”] and stepNumbers = [1, 10, 11, 2, 12, 111], the output should be launchSequenceChecker(systemNames, stepNumbers) = true.
There are three independent sequences for systems “stage_1”, “stage_2”, and “dragon”. These sequences are [1, 2], [10, 12], and [11, 111], respectively. The elements are in strictly increasing order for all three.
here is my code i am trying to figure out how to optimise this so it will run faster
(defun launchSequenceChecker (systemNames stepNumbers) (setf mmm (remove-duplicates (copy-seq systemNames) :test #'equal)) (setf lname (map 'list #'identity mmm)) (setf lnum (make-list (length mmm):initial-element '0)) (setf lnum1 (make-list (length mmm):initial-element '1000000001)) (loop named haha for x from 0 to (1- (length systemNames)) for name = (aref systemNames x) for name1 = (aref systemNames (- (1-(length systemNames)) x)) for num = (aref stepNumbers x) for num1 = (aref stepNumbers (- (1-(length systemNames)) x)) for pos = (position name lname :test #'equal) for pos1 = (position name1 lname :test #'equal) if(>= (nth pos lnum) num) do(return-from haha nil) else if(<= (nth pos1 lnum1) num1) do(return-from haha nil) else do (setf (nth pos lnum) num ) (setf (nth pos1 lnum1)num1) finally (return-from haha t)))
here are the constraints
[execution time limit] 6 seconds (lisp) [input] array.string systemNames An array of non-empty strings. systemNames[i] contains the name of the system to which the ith element of the master launch sequence belongs. Guaranteed constraints: 1 ≤ systemNames.length ≤ 5 · 10^4, 1 ≤ systemNames[i].length ≤ 10. [input] array.integer stepNumbers An array of positive integers. stepNumbers[i] contains the value of the ith element of the master launch sequence. Guaranteed constraints: stepNumbers.length = systemNames.length, 1 ≤ stepNumbers[i] ≤ 10^9. [output] boolean Return true if all the individual system sequences are in strictly increasing order, otherwise return false.
thank you for your time