[Solved] How to refacor a code use only loops and simple arrays?
public class Anagram { public static void main(String[] args) { String text = “!Hello123 “; char[] chars = text.toCharArray(); int left = 0; int right = text.length() – 1; while (left < right) { boolean isLeftLetter = Character.isLetter(chars[left]); boolean isRightLetter = Character.isLetter(chars[right]); if (isLeftLetter && isRightLetter) { swap(chars, left, right); left++; right–; } else { … Read more