Rotation
Practice
3.6 (96 votes)
Algorithms
Brute force
Easy
String manipulation
Easy
Problem
43% Success 19974 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given two strings \(S\) and \(T\) of the same length \(N\). Your task is to convert the string \(S\) into \(T\) by doing some operations. In an operation, you can delete the first character of the string \(S\) and append any character at the end of the string. You are required to determine the minimum number of operations to convert \(S\) into \(T\).
Input format
- First line: Single integer \(N\) denoting the length of the strings
- Second line: String \(S\)
- Third line: String \(T\)
Output format
Print a single integer that represents the answer to the question.
Constraints
\(1 \leq N \leq 10^3\)
Both strings consist of only lowercase alphabets.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
45 votes
Tags:
Ad-HocApprovedEasyImplementationOpen
Points:20
16 votes
Tags:
AlgorithmsEasyString Manipulation
Points:20
12 votes
Tags:
Ad-HocEasyString Manipulationapproved
Editorial
Login to unlock the editorial