https://helloacm.com/

转到作者网站

Given a graph represented by G(V, E) where V is the vertices and E represents the edges, we can do a Depth First Search Algorithm (DFS) on any node/vertex. The DFS will mark the current node visited... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Querying the Database e.g. MySQL could be very expensive relative to just a cache which is just a key value store . And for SELECT statements, we want to cache the results to speed up the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Let’s say we want to put a REL=NOFOLLOW on all external links in your wordpress posts/pages, we can add a filter to parse the content using the regular expression replace function e.g.... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

So you have designed your own website. What’s the next step? You need a domain and a host. Domains and domain names are relatively easy if you choose it correctly. Or, if you really want to purchase... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

One of the main problems that website owners face is slow loading times and poor website performance which can affect website search engine ranking and lose valuable traffic. The website speed is... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a date, return the corresponding day of the week for that date. The input is given as three integers representing the day, month and year respectively. Return the answer as one of the following... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a string S, return the number of substrings that have only one distinct letter. Example 1: Input: S = “aaaba” Output: 8 Explanation: The substrings with one distinct letter are... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. Example 1: Input: Output: Node 3 from... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Suddenly, you run npm run lint and it shows quite a lot of linebreak-style errors. Your Visual Studio Code suddenly does not show you the lint errors as well. You probably run npm run lint —... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. The left subtree is the maximum tree constructed... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example, given inorder = postorder = Return the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Design and implement an iterator to flatten a 2d vector. It should support the following operations: next and hasNext. Example: Vector2D iterator = new Vector2D(,,]); iterator.next(); // return 1... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum integer in the array is 9... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum integer in the array is 9... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

In NodeJS unit testing frameworks such as mocha/chai, you could add .only after describe or it, so that the specific set of tests are run, which excludes/disables all other tests. For example,... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words. It is guaranteed there is at least one word that isn’t banned, and that the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

There are N cities numbered from 1 to N. You are given connections, where each connections = represents the cost to connect city1 and city2 together. (A connection is bidirectional: connecting city1... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a string S, return the number of substrings of length K with no repeated characters. Example 1: Input: S = “havefunonleetcode”, K = 5 Output: 6 Explanation: There are 6 substrings... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level X such that the sum of all the values of nodes at level X is maximal.... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]