Exploring bulkWriteMongoDB has many interesting built-in methods, and one of them is bulkWrite, which allows batch processing of write operations in a specified order. This method has been available since version 3.2. The syntax of bulkWrite is simple: db.collection.bu...2 min read·ubuntumeta.hashnode.devJun 8, 2023
How to choose Math.ceil and Math.floor correctlyMany times we want to calculate something by dividing operations.But we might get a float value as a result, for example, 5 / 2 = 2.5. In javascript, we have Math.ceil and Math.floor method to use. They have a huge difference from each other. The Mat...1 min read·ubuntumeta.hashnode.devMay 30, 2023
Zigzag conversionHere is the solution of python: lass Solution: def convert(self, s: str, numRows: int) -> str: if numRows == 1 or numRows >= len(s): return s # Create an empty list to hold characters in each row rows = [''] ...1 min read·ubuntumeta.hashnode.devApr 25, 2023
Expand way to solve longest palindrome stringLet's continue to talk about the longest palindrome sub string question.The brute force way take has poor performance. We can consider expanding a specific position from a string to find the longest palindrome sub-string.Look for each character and c...2 min read·ubuntumeta.hashnode.devMar 29, 2023
Brute way to solve longest palindrome substring questionThe longest palindrome substring is an interesting question in computer science.Many people solve it in different ways. Today I will introduce the most direct way, the brute force solution to handle this problem.Actually, I wan to write it in javascr...2 min read·ubuntumeta.hashnode.devMar 29, 2023