08-22:收到OA1 link. Χ
08-28:完成OA1(4道题,2道coding,2道解释coding的approach). 1point 3acres
Q1:ChooseFleet - given an integer denoting a total number of wheels, help Amazon Logistics from an infinite supply of two-wheeled and four-wheeled vehicles such that the group of chosen vehicle has that exact total number of wheels. Two ways of choosing vehicles are considered to be different if and only if they contain different numbers of two-wheeled or four-wheeled vehicles. ..
For example, if our array wheels = [4,5,6] ur return array would be res = [2, 0, 2]. Case by case, we can have 1 four-wheel or 2 two-wheel to have 4 wheels. we cannot have 5 wheels. We can have 1 four-wheel and 1 two-wheel or 3 two-wheel vehicles in the final case.
Q2: 解释Q1approach
Q3:TraversedPath - You are in charge of preparing a recently purchased lot for one of Amazon's new building. The lot is covered with trenches and has a single obstacle that needs to be taken down before the foundation can be prepared for the building. The demolition robot must remove the obstacle before progress can be made on the building.
Write an algorithm to determine the minimum distance required for the demolition robot to remove the obstacle.-baidu 1point3acres
Assumption:
The lot is flat, except for trenches, and can be represented as a two-dimensional grid. the demolition robot must start from the top-left corner of the lots, which is always flat, and can move one block up, down, left, or right at a time. The demolition robot cannot enter tranches and cannot leave the lot. The flat areas are represented as 1, areas with trenches are represented by 0 and the obstacle is represented by 9.
Q4: 解释Q3approach. Χ