Skip to content

[6 KYU] Backspaces in string (Solution) #142

Open
@Hycord

Description

@Hycord

I decided to use typescript.

export function cleanString(s: string): string {
  let ret: string[] = [];
  
  s.split("").forEach(r => {
    if(r == "#"){
      ret.pop();
    } else ret.push(r);
  })
  
  return ret.join("");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions