NeetCode #97LC-791MediumArrays & Hashing
← Back to All Problems

#97 · #791 · Custom Sort String(自定义字符串排序)

📌 Problem Statement & Constraints

You are given two strings order and s. Reorder s so that its characters follow order's ordering; characters not in order are placed at the end in ascending order. Constraints: 1 <= order.length <= 26, 1 <= s.length <= 200; order and s consist of lowercase letters, and order has distinct characters.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!