How to optimize speed of this Laravel console command
Here is a console command I wrote in Laravel, and I was wondering how can I make it better and faster? What have I done wrong? And if you can introtuce me a book so I can get better at…
Here is a console command I wrote in Laravel, and I was wondering how can I make it better and faster? What have I done wrong? And if you can introtuce me a book so I can get better at…
I want to search in a List of Strings, but the search query does not need to be in order as the result. Let's say I have a list of strings List<String> a = [ Fracture of right arm, Fracture…
I'm having a hard time finding a solution for this and I don't even know if it's possible... I'm developing a small app where I have 5 types of items with different stats, 7 levels (some have only 3 levels),…
I would like to convert a list of H1 through H6 tags from a markdown file into a Javascript hierarchy for use in a Table of Contents. Currently the list is generated by AstroJS in this format [{depth: 1, text:…
I have a table that contains students publications like this id student 1 john 2 anthony 3 steven 4 lucille 5 anthony 6 steven 7 john 8 lucille 9 john 10 anthony 11 steven 12 lucille 13 john so the…
Let's say I have a table in Postgres that stores a column of strings like this. animal cat/dog/bird dog/lion bird/dog dog/cat cat/bird What I want to do, is calculate how "correlated" any two animals are to each other in this…
I was able to write an even faster sort for integers! It sorts faster than the array can be generated. It works by declaring an array to be of length equal to the max value of the integer array to…
I am preparing for a technical round and while preparing I encountered this problem through leetcode's interview questions section. My solution can take 3 items in its input dict anything less than that it throws error. I would also like…
I need to find duplicates by rounded coordinates and store the indices, then remove elements from the original array by these indices. How can I do this with O(n) ? func removeDuplicate(from points: [Point]) -> [Point] { var originalPoints: [Point]…
I'm just learning learning python and don't know many things. At the moment I'm building a telegram bot that can help you to find appropriate text to read in foreign lang. The core function I want to implement is: The…