current position：Home>HUAWEI Machine Test Real Questions Java Realization [Vehicles with the Most Colors] [2022.11 Q4 New Questions]
HUAWEI Machine Test Real Questions Java Realization [Vehicles with the Most Colors] [2022.11 Q4 New Questions]
Table of Contents
At a narrow intersection, only one car can pass per second, assuming that there are only 3 colors of good cars, find out the cars with the most colors that pass by within N secondsquantity.
The three color numbers are 0, 1, 2
The first line is the color information of the vehicle passed
[0,1,1,2] means that the colors of vehicles that pass in 4 seconds are 0 , 1 , 1 , 2
The input in the second line is the statistical time window, integer, and the unit is second
Outputs the number of vehicles with the most colors that pass within the specified time window.
0 1 2 1
There is a maximum of 2 occurrences of each color within the 3 second time window.For example
author[MISAYAONE],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Kia's new kx3 Proud Run interior real shot exposure, or next year launched
- Ideal one is replaced with a 1.5t four-cylinder engine, is it worth starting?
- Weimar's "stall" salary cut is not an exception. How can new forces survive the cold winter?
- 2022 New Car Recommendation丨Commercial, pure electric, high-end, everything, these all-round pickups are no worse than SUVs
- Geely Automobile: No adjustments have been made to the prices of its new energy vehicles
- TrendForce: Q3 new energy car sales rose 70% year-on-year, byd, charting the mixed model
- Shop Exploration|Young people don’t know what car to buy, they “buy” after reading the BAIC Rubik’s Cube
- Hongqi entered the MPV market again. Is Hongqi really going to fight back in the past two years?
- I ran into a JEEP Gladiator, and the lengthening is still very handsome!
- Hardcore American Pickup——Gladiator's store visit
guess what you like
Iron man tenderness, in-depth test drive Audi RS 5
How to choose an electric tricycle?Which brand is better?An insider analyzes it for you, don’t choose the wrong one again
Taobao express how to optimize the keywords?
Increasing income without increasing profits, less than a huge loss of 14 billion in four years, it is difficult for Tuhu to support itself by maintaining a car
Three sets of power, eight configurations, which one of GAC Trumpchi Yingku is worth starting?
The new Volkswagen Touareg tastes the dignity of its own flagship SUV
Guard 130 is here!8 seats up to 5 meters 3, positioning off-road "MPV" or 900,000 for sale
If you want to buy a car in the near future, the declaration pictures of these 6 joint venture new cars have been exposed, and the models are heavy
Lotus' first SUV, experience ELETRE first!
Wisdom of cool personality trend technology carnival party chery unbounded Pro officially listed 89900 yuan
- Ruilan 9 will be launched soon, what is the point of Ruilan battery replacement?everything you want to know is here
- Smart Technology Carnival Personality Fashion Party Chery Unbounded Pro is officially launched, starting at RMB 89,900
- From technical self-reliance to technical self-confidence, how high is the gold content of Nezha Auto's "Hao Zhi"?
- The new choice of scooter, the smart little monster Chery Unbounded Pro is launched, the price starts from 89,900
- Li Xueqin organizes the game, big coffee relatives and friends help out, Ruicheng PLUS appears in "Today's Show"
- Business Exploration: A small town in Canada has become a hot spot in the battery supply chain
- Passenger car or tool? What is the future of Chinese pickup trucks?
- SAIC MAXUS fights hard-core off-road market again: Territory is launched with diesel light hybrid power, with fuel consumption as low as 9L
- Jikrypton responded that it would not follow the trend to make price adjustments; Mazda coupe exposure
- The huge advertisement of the Audi 4S store is calling out to the dealers, and it hurts all the traditional tycoons
- The whole series is hybrid, and the new Alison in the store has a radical appearance, simple and avant-garde interior
- [Xingdong Private Car Phase 3] The market is back to turbulence, stick to the low-level layout
- Geely Xingyue L new model released, it is very cost-effective
- [Rong e-Voting · "Easy" to set off] Easy-to-invest leads the investment plan to set sail, and the departure time is scheduled every Thursday. The "index pie snowball" strategy calls you to get on the train~
- FAW Toyota's new MPV is here, and the new image makes consumers shine
- Honda "Small Crown Road" is here, the interior is very technological and the details are very avant-garde
- In the competition for the hegemony of the battery line, "spare tires" appear frequently, who can become the mainstream?
- Real shots of Land Rover Lanyun Year of the Tiger Special Edition, a handsome, fun and family-friendly car
- The new generation of Honda CR-V is released, its strength should not be underestimated
- The real car of the new Audi A6L is exposed, with a strong sense of lines, very sci-fi
- Honda Odyssey also launched a 4-seater version, with appearance, configuration and comfort online at the same time
- Test drive Toyota bZ4X: Although there are not many bright spots, it is still a trustworthy Toyota car
- "Need for Speed Boogie" map like?List of map introduction
- The lowest fuel consumption is 3.8L, and the horsepower reaches 317 horsepower. Are hybrid A-class sedans like this?
- Selling 85,900 yuan Xinyuan Golden Sea Lion new models listed
- The Chaozhou car accident exposed that Tesla cannot be both an athlete and a referee
- Why are extended-range hybrids rarely used in low-end cars?Cognitive Bias Bubbles That Will Burst With A Little Poke
- New car exposure: Wuling version Jimny, ET5 travel version, BYD off-road, which one makes your heart beat?
- Is Auchan X5 PLUS "cutting leeks" or real "strength"?Netizen: 100,000-level first choice!
- The MPV market is surging, why can Alison not fall down for a long time?
- In order to accelerate the process of electrification and intelligence, what has SAIC-GM done?
- Zero run car first stores opened Israel: T03 to deliver local users
- GM plans to launch more than 15 all-electric vehicles in China by 2025
- More than 200,000 to buy a luxury SUV why choose Audi Q3?Peak appearance, strong sense of technology, high configuration!
- Car news: Honda Pilot launched overseas; Chevrolet new car; New Tour Rio official map
- The heart of autonomous driving: millimeter-wave radar-visual fusion perception method (pre-fusion/feature-level fusion/data-level fusion)
- The first choice for the 100,000-class sports SUV, the Auchan X5 PLUS is on pre-order, don’t miss it!
- New Year outback gauge the Toyota RAV4, this configuration also too snap aggro
- SK On's new EV battery factory in Hungary has started installing equipment, supplied by around 20 manufacturers
- Get the prize and get soft!This team from China blew up the track again!