Student
more
Okay, so I’m premed who likes to code, so I’m just gonna start now. I did a question yesterday on binary search and I will attempt to answer it again right now.
Something like that I think…. let me double check
So I got it wrong. I needed left <= right for it to include the arrays/lists are that exactly 1 in length.
Also, needed to return -1 for the wrong answer.
Okay, and today I worked on another question. It called the robbery house question, or largest sum of the nonadjacent values. I saw it on TikTok. Essentially, you have a list of numbers or an array of numbers and your goal is to determine the largest sum given any numbers that are not adjacent to each other, where all the numbers are greater than or equal to zero. There’s also some other restraints…
My answer is pseudocode was really not pseudocode here…
and it failed… :(
So I looked up the solution and found out how this is wrong… What it looks like people do is use dynamic programming to contain the largest value as it iterates down the array. What I put, though, is pretty similar I think.
My attempt to recall the solution from memory:
oh shit… we had to go back in the list, not forwards…
Got it… :)
i def did not skip a day Question 1: First Bad Version Today I got to solve a problem called first bad version. What you essentially do is try to find which is the bad version given that a function tells you whether or not it is a bad version. All versions after a bad version become bad. For example FFTTTTTTT, The index at 2 or the 3rd item is...
read more
The first step…trying to get scanpy… pip install scanpy This basically failed… I needed python tables and thank the lord for this I can finally start…haha I lied c:\users\melton\appdata\local\programs\python\python39\lib\site-packages\tables\__init__.py in <module> 12 13 # Necessary imports to get versions stored on the cython extension ---> 14 from .utilsextension import ( 15 get_pytables_version, get_hdf5_version, blosc_compressor_list, 16 blosc_compcode_to_compname_ as blosc_compcode_to_compname, tables\utilsextension.pyx in init tables.utilsextension() __init__.pxd in numpy.import_array() ImportError: numpy.core.multiarray failed to import...
read more