Ad
  • Custom User Avatar

    Great point! I think that would be quite a bit better in almost every case. The only issue I can think of is that str1 could be significantly longer and it would then be a bit memory intensive.

  • Custom User Avatar

    Why not do it reverse, requirements be str1 and if for second loop we receive null we will return false?
    We will not need to go through the entire (second)loop if a character is missing