0%

变化中的不变

The secret to that is to focus on the things that don’t change in your buisiness.
——Jeff Bezos

Problem 20: Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

1. Open brackets must be closed by the same type of brackets.
2. Open brackets must be closed in the correct order.

Note that an empty string is also considered valid.

Problem 821: Shortest Distance to a Character

Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string.

Example 1:

Note:

1. S string length is in [1, 10000].
2. C is a single character, and guaranteed to be in string S.
3. All letters in S and C are lowercase.

Why are we interested in this?

These days I knew something called “Gimbal”, which offsets random movements of camera when we are videoing or shooting, in order to make smoother video. It acts like this

Also, several days before, we carefully analyze divers’ physics during diving.