FOR FREE MATERIALS

Short URL.

Back to Programming

Description

You are given a long URL. Convert it to short URL.

Conditions 

Short URL will contain 6 to 10 characters randomly which may be mix of digits, uppercase, lowercase characters

INPUT: www.mycarrerwise.com

OUTPUT: https:// www.shortUrL.com/7xtuZP860

Code

Time complexity: O(L)           /for the loop

Space complexity: O(1)          /As checking one time only