using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; namespace Test1 { class Program { static void Main(string[] args) { string s1 = "abc"; string s2 = &quo…
class Solution { public: bool backspaceCompare(string S, string T) { int szs=S.size(); int szt=T.size(); ,endt=; ;i<szs;i++) //get the result string of S { if(S[i]=='#') { ) ends--; } else S[ends++]=S[i]; } ;j<szt;j++) //get the result string of T {…