Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Python, thank you! 12. [Programming] Signal Matches A signal is monitored every second starting at t=0, when its value is recorded as an

image text in transcribed

Please use Python, thank you!

12. [Programming] Signal Matches A signal is monitored every second starting at t=0, when its value is recorded as an integer. An example signal might look like: 103 25 4 30 2 17 which is a sequence of positive integers separated by a single space each. Your program reads in two lines on Standard Input, each denoting a separate signal. The signals may be of unequal length. We say that two signals match when they have the exact same value at the same time. Your task: Given two signals, how many distinct values do they match on? Print your answer on Standard Output. Example Input 10 3 25 4 30 2 174 93 20 41 142483 Output: 2 Explanation The two signals match at three different points, 1,3 and 7 seconds with values 3, 4 and 4 respectively. Thus they match on two distinct values 3 and 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions