Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. You are given the s s and t. Both strings have the same length.
  2.  
  3. You are allowed to modify s. In each step you may choose two valid indices i and j such that i > j, and change s[i] to s[j]. For example, if s = "abc", you may choose i=2 and j=0, which will change s to "aba".
  4.  
  5. Return "Possible" (quotes for clarity) if you can change s into t by a sequence of zero or more steps. Otherwise, return "Impossible".
  6.  
  7. Note that the return values are case-sensitive.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement