#3798

Largest Even Number

easy · 69.3% accepted · 65 likes · top 77%

string

Description

You are given a string s consisting only of the characters '1' and '2'.

You may delete any number of characters from s without changing the order of the remaining characters.

Return the largest possible resultant string that represents an even integer. If there is no such string, return the empty string "".

Solution