Convert given Strings into T by replacing characters in between strings any number of times

  public class GFG {                  static String checkIfPossible(        int N, String[] arr, String T)    {                        int[] freqS = new int[256];                          int[] freqT = new int[256];                          for (char ch : T.toCharArray()) {            freqT[ch – ‘a’]++;        }                  for (int i = 0; i < N; i++) {                                      for (char ch : arr[i].toCharArray()) {                freqS[ch - 'a']++;            }        }          for (int i = 0; i < 256; i++) {                                      if (freqT[i] == 0                && freqS[i] != 0) {                return "No";            }                                      else if (freqS[i] == 0                     && freqT[i] != 0) {                return "No";            }                          else if (freqT[i] != 0                     && freqS[i]                            != (freqT[i] * N)) {                return "No";            }        }                  return "Yes";    }          public static void main(String[] args)    {        String[] arr = { "abc", "abb", "acc" };        String T = "abc";        int N = arr.length;        System.out.println(            checkIfPossible(N, arr, T));    }}