Skip to content

Instantly share code, notes, and snippets.

@Tiny-Giant
Last active February 29, 2016 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tiny-Giant/a74488a5b3a44be68264 to your computer and use it in GitHub Desktop.
Save Tiny-Giant/a74488a5b3a44be68264 to your computer and use it in GitHub Desktop.
public class interLeave
{
public static void main(String[] args)
{
String you = "hhhh";
String me = "aaa";
int length = Math.max(you.length(), me.length());
for (int i = 0; i < length; i++)
{
if (i < you.length())
{
System.out.print(you.charAt(i));
}
if (i < me.length())
{
System.out.print(me.charAt(i));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment