Maximum Bags With Full Capacity of Rocks
1. calculate the left part of each rock mapping with capacity.
2. sort the left array, we should fulfill the least needs for the rock.
3. if our left additional block is enough, we can accumulate the count of max b…https://t.co/vnzmqybDNC
Maximum Number of Groups Entering a Competition
1. sort the grades array.
2. Important: use an array tuple, first save the count of the number, and second save the sum of all values in this group.
3. if conditions are all passed, accumulate the count.
#l…https://t.co/7rLpd6swr2
Replace Words
1. split the sentence into a word list with a blank space.
2. replace the word in the sentence if it starts with the word in the dictionary, and use the shorter length if there are many matches.
3. use the original word if it doesn't start w…https://t.co/ZiAZuVZKfc
Minimum Rounds to Complete All Tasks
1. count the frequency of the num appeared in tasks.
2. choose 3 when the count of the number is bigger or equal to 5.
3. if the count is equal to 4, it means we have double 2.
4. reset the result to -1 if the left is…https://t.co/MvT0Pf6J5U
Search Suggestions System
1. Sort the products in lexicographic order, and compare the character one by one.
2. take the first three words based on the input word.
3. for the lexicographic, we should not only consider the lexicographic order, but also the…https://t.co/1ZtMuhNZ1f
Evaluate the Bracket Pairs of a String
1. Map the key with parenthesis to the value in knowledge.
2. search the left and right parenthesis, and then replace it with the value in the map, if the key doesn't exist, use key replace.
3. for each loop, we will…https://t.co/P9Mq8t4hL6
Solution:
1. Iterate the paths array, and join the relative parent path with the filename
2. push the full path to the array, and save a pair of content keys and full paths to the map.
3. iterate all the content keys, and filter all full paths with a len…https://t.co/ahDCbxk6SR
The difficulty of this problem is to construct the same hash string of the special equivalent string.
we can get it by joining the sorted odd index string and sorted even index string, then it's easy to judge whether a new special equivalent string has a…https://t.co/DHsq8iHaq7
It's been a long time since I resigned from my last company(BMYG Financial Group), and I hope to find my next job in the following month and open more possibilities in my career.
During these last 3 months, I have done some work between front-end develop…https://t.co/yBSkjhVhhM
I have done exercises in Leetcode for almost 2 weeks, what’s the most factor for finding the job, problem-solving ability? or what should I do to improve my chance to find the job?
Error Boundaries have been a feature in React for years, This article explains it very well, from try-catch step by step and then transition to ErrorBoundary component, and the usage of useErrorHandler to handle async errors and useHooks errors. https://t.co/q8fHPssHFd
It is one of the best-known principles of software development and observing it is very important when building an application or writing code in general.
Higher-order components (HOCs) in React were inspired by higher-order functions in JavaScript. A HOC is an advanced technique for reusing logic in React components. It is a pattern created out of React’s compositional nature.
HOCs basically incorporate the don’t-repeat-yourself (DRY) principle of programming, which you’ve most likely come across at some point in your career as a software developer.