Two Characters Hackerrank Solution