Two Sum Attempt to recall: Question is “Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.” Intersection of Two Arrays vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { vector<int> ans; vector<int>::iterator it; for(int i = 0; i < nums1.size(); i++){ it = find(nums2.begin(),nums2.end(),nums1[i]); if( it != nums2.end() ){ ans.push_back(nums1[i]); *it = -1; } } return ans; } vector<int>...
read more
Okay, so I tried to take notes but it was so boring. I’d rather do questions. There’s this thing called study plan on leetcode which I’m prolly just gonna follow. I clicked on all three study plans: algorithms and dynamic programming (DP). And lemme just say I kinda struggled with the two already for data structures. I started at around 12:30 PM and now it’s 2:06 PM. Contains Duplicate The...
read more
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
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. Binary Search def binary_search(nums, target): left = 0 right = len(nums) - 1 while(left < right): mid = int((left+right)/2) if( nums[mid] < target ): left = mid + 1 elif( nums[mid] > target ): right = mid -...
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
Damn it was hella easy to start a blog. All I did was follow the steps here and I was able to make some posts and talk about myself. The reason I wanted to create a blog was to essentially make an online journal noting my achievements and failures and to show other human beings that I actually do some kind of work. Anyways. Go ahead and look through these...
read more
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated. Jekyll requires blog post files to be named according to the following format: YEAR-MONTH-DAY-title.MARKUP Where YEAR...
read more