class Utils {

  public static String findActualPath(String path, int pathIndex) {
    if (pathIndex <= 0) {
      return path;
    }

    int fromIndex = 0;
    int counter = pathIndex;
    char[] chars = path.toCharArray();
    for (int i = 0; i < chars.length; i++) {
      if (chars[i] == '/') {
        if (--counter < 0) {
          fromIndex = i;
          break;
        }
      }
    }
    return fromIndex > 0 ? path.substring(fromIndex) : "";
  }

  private  Utils();

}