temporary variable for performing the swap we do constant amount of processing per entryso the time complexity is (narray problems often have simple brute-force solutions that use (nspacebut there are subtler solutions that use the array itself to reduce space complexity to ( filling an array from the front is slowso see if it' possible to write values from the back instead of deleting an entry (which requires moving all entries to its right)consider overwriting it when dealing with integers encoded by an array consider processing the digits from the back of the array alternatelyreverse the array so the least-significant digit is the first entry be comfortable with writing code that operates on subarrays it' incredibly easy to make off-by- errors when operating on arrays--reading past the last element of an array is common error which has catastrophic consequences don' worry about preserving the integrity of the array (sortednesskeeping equal entries togetheretc until it is time to return an array can serve as good data structure when you know the distribution of the elements in advance for examplea boolean array of length is good choice for representing subset of { (when using boolean array to represent subset of { }allocate an array of size to simplify indexing when operating on arraysuse parallel logic for rows and for columns sometimes it' easier to simulate the specificationthan to analytically solve for the result for examplerather than writing formula for the -th entry in the spiral order for an matrixjust compute the output from the beginning table top tips for arrays know your array libraries arrays in python are provided by the list type (the tuple type is very similar to the list typewith the constraint that it is immutable the key property of list is that it is dynamically-resizedi there' no bound as to how many values can be added to it in the same wayvalues can be deleted and inserted at arbitrary locations know the syntax for instantiating liste [ ][ [ list(range( )(list comprehensiondescribed lateris also powerful tool for instantiating arrays the basic operations are len( ) append( ) remove( )and insert( know how to instantiate arraye [[ ][ ][ ]