https://helloacm.com/

转到作者网站

Given a sorted list of disjoint intervals, each interval intervals = represents the set of real numbers x such that a <= x < b. We remove the intersections between any interval in intervals... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Tic-tac-toe is played by two players A and B on a 3 x 3 grid. Here are the rules of Tic-Tac-Toe: Players take turns placing characters into empty squares (” “). The first player A always... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

PUSHD/POPD is a great pair of tools that exist in modern operating system e.g. Windows, Linux or MAC. It allows you to jump forward and backwards between directories. The pushd takes a directory,... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Reversing a List/Array is very commonly needed and there are three ways to reverse a list or array in Python. Using the .reverse() method to reverse a list or array Note: this method does not work... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval lists. (Formally, a closed interval (with a <=... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: Output: Explanation: 0,1,2 form a continuous range; 4,5 form a continuous range. Example 2:... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Last week, we talked about the LED pixels. And by using the knowledge we have learned so far, we can make a pixel running on the Microbit’s LED. Last week, the pixel is running from the first... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

The Magik programming does not have an inherent enumerate method like Python, however, it would be trivial to make one: _global enumerate << _iter _proc@enumerate(list) _local i << 0... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

ou are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

In Python, the enumerate function is an iterator that returns/yield each time a tuple that contains an index (starting from 0 and incrementing) and the element in the list. In Javascript, we can... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

We are given that the string “abc” is valid. From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated with Y) is equal to V. (X or Y may be empty.)... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: Output: 2 Explanation: is the longest contiguous subarray with equal number of... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Last week, we talked about the loops (for and while), this week, we’ll learn the basics of the LED screen of the Microbit. Basics of LED The LED is a tiny ‘screen’ that Microbit... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

You are given an immutable linked list, print out all values of each node in reverse with the help of the following interface: ImmutableListNode: An interface of immutable linked list, you are given... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Getting calls from people you don’t know can be infuriating and annoying. You never get to know whether it is your old friend, your son’s music teacher from 5 years ago, cold-call marketers, or... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

If you experience WIFI (Wireless Networks) Intermittency issue, then keep reading below. The Intermittency issue means that your devices (smartphones, or laptops) occasionally lose the wireless... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->->->2->1->NULL Follow up: A linked list can be reversed either iteratively or... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Kubernetes is getting popular these days – as it is a wonderful way to deploy your applications on the cloud and it scales easily (horizontally). The kubectl get pods is a most-common used... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a Integer, we want to convert it to binary string. We can do this iteratively, by concatenating the modulus by two result and shifting the number 1 position to the right. We also need to check... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a 2D Grid with integer values representing the colours, you are asked (in an interview probably) to find out the maximum connected colour sizes. A colour is connected to another if it is... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]