Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

User Question 8 0 Max. score: 2 0 . 0 0 URL Checking URL Checking Given a URL, you have to write the main URL

User
Question
80
Max. score: 20.00
URL Checking
URL Checking
Given a URL, you have to write the main URL and the parameters passed in the form of a report (check the example). Also, the reference values of all parameters are given. You have to check if the values of all parameters are less than or equal to the values given. If so, then print 200 at the end of the report, else print 404.
Note:
The parameters list in the reference values can have more parameters than the ones present in the URL. But it is guaranteed that all parameters in the URL are present in the list.
The base url and the parameters are separated by a "?"
Different paramaters are separated by a ","
Task
Generate a report on the URL given.
Example
Assumptions
url = https://leetcode.com/problemset/all/?page=4
N =2
params =[page,difficulty]
val =[5,2]
Output
https://leetcode.com/problemset/all/
1
page 4
200
Approach
The main url is https://leetcode.com/problemset/all/, there is only 1 parameter page with value 4. Hence, the parameters are Ok, so we print 200.
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
The first line contains the URL
The second line contains N the number of parameters.
The third line contains N space-separated strings denoting the parameters.
The fourth line contains N space-separated integers denoting the reference values of the parameters.
Output format
Print the answer in the given format.
The first line contains the main URL.
The second line contains M, the number of parameters.
Then M lines follow. Each line contains a string, the parameter and a value of the parameter. Print the parameters in sorted order.
The last line contains the status.
Constraints
1
<=
|
|
<=
10
5
1
<=
<=
100
1
<=
|
[
]
|
<=
10
1
<=
[
]
<=
10
9
Sample input
https://leetcode.com/problemset/all/?page=4
2
page difficulty
52
Sample output
https://leetcode.com/problemset/all/
1
page 4
200
Explanation
Given in statement
The following test cases are the actual test cases of this question that may be used to evaluate your submission.
Sample input 1
www.wmjnxjvhn.com?juvbc=12345,uesbp=67890
10
juvbc uesbp oetwuq sfbsqk elvfka aoxdqc dstgyt ppredp peamvu pswffa
1880527381384302847099893963006329328333773917987439735443771362298233149583544379535039
Sample output 1
www.wmjnxjvhn.com
2
juvbc 12345
uesbp 67890
200
Sample input 2
www.vjvjgcnmwnthcfthhopcxjgkumlhnkswfniliqbqgtvhykiwnyhcspwhlrrykquwkqvxldeqcmsjfrcxingterkukkffrkhpqrmbtyypodnphjvjrjnoyighynjxicscarfktarelgcifubtludiosoemldsordmmpkxfhamxvcwexnoyfpnyyeamvrtsbgxorylfdwdrpcxebqdtnjsusyhruxivbhfvamluhiwctfgjuieoshsilyrslfqfkecfaspniyfcrkwwnlgauxaeueejjjloaxfbtkbrnoqqftwyyvldkopdkflneysnarkthjjpyacihxkoidrirkbvlgiyykexbovdsybijqrkyklgrghuneagvoaxcjsgrrvolubhjdkswdekqseuaolxkfglsocvrqjakftqiqneglrndmruecbabiyvjefbqwtuskrginwavrsarcjrrqmwhcnyqnfuxhqvudcpslpbyntbhbupoiccdlycqydbdnumswooyvljjbsisvbgsihdgcddprqeyhxyyiwcwprf

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_2

Step: 3

blur-text-image_3

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 Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions