NeetCode #806LC-1717MediumGreedy
← Back to All Problems#806 · #1717 · Maximum Score From Removing Substrings(删除子字符串的最大得分)
📌 Problem Statement & Constraints
You are given a string
s and two integers x and y. You may remove the substring ab for x points or ba for y points, any number of times. Return the maximum score. Constraints: 1 <= s.length <= 10^5, 1 <= x, y <= 10^4.🔒
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!