跟随,学习,进步

Acm

The Ultimate Computer Technology Blog | The Knowledgebase of Computing

https://helloacm.com/
转到作者网站

Algorithms to Count the Number of Palindromic Substrings

Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are counted as different substrings even they consist... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Algorithm of Two Pointer (Sliding Windows) to Find All Anagrams in a String

Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters only and the length of both strings s and p will not be... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Depth First Search Algorithm to Find Leaves of a Binary Tree

Given a binary tree, collect a tree’s nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example: Input: 1 / \ 2 3 / \ 4 5 Output: ,,] Explanation:... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Breadth First Search Algorithm to Check Completeness of a Binary Tree?

Given a binary tree, determine if it is a complete binary tree. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Algorithms to Remove All Adjacent Duplicates In a String

Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make duplicate removals on S until we no longer can.... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


The NegaBinary Algorithm – How to Convert to Base Minus Two (-2) ?

We know the binary conversion, which is base two. The algorithm to convert to binary for a decimal integer, is to divide by two and concatenate the remainder in the reverse order. How about negative... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Greedy Algorithm to Find the Largest Perimeter Triangle by Sorting

Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossible to form any triangle of non-zero area, return... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Keep Your WordPress Website Secure?

WordPress is the most popular content management platforms. Unfortunately, it’s not only popular with bloggers and businesses, but also for malicious actors: hackers, spammers, nefarious... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Find Largest Value in Each Tree Row/Level using BFS or DFS Algorithm?

You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: This puzzle requires level-by-level traversal of a tree/binary tree, thus the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Start a Podcast on WordPress?

Podcasts are becoming quite popular these days and for good reason. Many people like to listen to something motivational or useful while on the go. It’s like the radio. You can only listen to a... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Low PHP-FPM max_children value causes Website Slow to Response + CloudFlare 524 Error

The cloudflare 524 error means that a TCP/IP connection has been established to your server but the server fails to response with HTTP code/status within a time frame, usually 100 seconds before... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Big Data Case Study: TV Usage and Power Consumption

Want to challenge yourself before you go to apply the Data Scientist/Machine Learning/Big Data jobs? You are given the data of total (aggregated) power consumption of two days in a household. This... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Understanding The Math Before Investing In Stocks

People have been flocking to different investments over the past few years, and for good reason. The economy isn’t exactly stable and those without investment seriously jeopardize their... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Prune a Binary Tree in C++?

We are given the head node root of a binary tree, where additionally every node’s value is either a 0 or a 1. Return the same tree where every subtree (of the given tree) not containing a 1 has... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Algorithm to Compute the Shortest Distance between Points on Two Lines

Let U = represent a increasing series of points; xu0 < xu1 && yu0 < yu1, etc. Let D = represent a decreasing series of points; xd0 < xd1 && yd0 > yd1, etc. U and... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


C++ Algorithm to Compute the One-Dimensional (Linear) Interpolated Values

Consider the time series of measurements m = and time points t1 = respectively and another sequence of time points t2 = . Write a function to, where possible, return the one-dimensional... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


C++ Algorithms to Find Pair of Sum Given a Collection of Numbers

This is quite similar to the Two Sum puzzle. Given a collection of numbers, write a function that finds a pair that will sum to a given value. For example, the sum we are looking for is 10 and the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Implement strStr() function in C++?

Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = “hello”, needle =... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


How to Check Valid Word Abbreviation in C++?

Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation. A string such as “word” contains only the following valid... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]


CloudFlare Enterprise Plan Overview

Features on Enterprise Plan of CloudFlare Cache by device type (Mobile, Tablet, Desktop) – Create better experiences for your customers Bot Management – protection from content scraping,... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]