https://helloacm.com/

转到作者网站

Given a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters between and tags become bold. The returned string should use the least number of tags... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if there exists i, j, k such that arr < arr... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

For strings S and T, we say “T divides S” if and only if S = T + … + T (T concatenated with itself 1 or more times) Return the largest string X such that X divides str1 and X... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

The Facebook Onsite Interview will generally consist of three parts: Motivations, and Part 2 Coding/Algorithm, and Part 3 Product Design. This is the Part Three: Design. The so-called Design problems... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a forest (a disjoint union of trees). Return the... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: A move is guaranteed to be valid and is placed on an empty block. Once a winning... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Update: I have been careful enough not to leak any confidential information after signing the NDA (non-disclouse agreement) with Facebook. I think, the NDA refers to confidential information such as... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

The Facebook Onsite Interview will generally consist of three parts: Motivations, and Part 2 Coding, and Part 3 Product Design. This is the Part Two: Coding. At least 2x 45mins interviews where you... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have one or more children processes. This is just... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

In a given grid, each cell can have one of three values: the value 0 representing an empty cell; the value 1 representing a fresh orange; the value 2 representing a rotten orange. Every minute, any... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Congratulations! You have passed the CV screening and the telephone coding assessment of Facebook. Facebook interviews are hard, like other Giants: Google, Amazon, or Microsoft. In Facebook, every... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Let’s say, we have an array in Javascript, and we want to group the elements, ount their occurences and store the final results in a key-value dictionary. Input Array: const cars = ; Output... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B are balanced parentheses strings. (A) has score 2... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given an array A of integers and integer K, return the maximum S such that there exists i < j with A + A = S and S < K. If no i, j exist satisfying this equation, return -1. Example 1: Input:... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: “aba” Output: True Example 2: Input: “abca”... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a square array of integers A, we want the minimum sum of a falling path through A. A falling path starts at any element in the first row, and chooses one element from each row. The next... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

In Javascript, you can use Number.prototype.toFixed(n) that will return a string version that has n decimal places. For example, (3).toFixed(3) // "3.000" (3.15).toFixed(3) // "3.150" The toFixed... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Given a string S of ‘(‘ and ‘)’ parentheses, we add the minimum number of parentheses ( ‘(‘ or ‘)’, and in any positions ) so that the resulting... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]

A while ago, I was applying a job (Principal Software Engineer) for Microsoft, in Cambridge the Microsoft Research Center. Big IT giants have their own Recruitment teams, and I was contacted by one... [[ This is a content summary only. Visit my website for full links, other content, and more! ]]