from typing import List


def justify_stringlist(j: List[str], right=False) -> List[str]:
	"""
	CONSOLE FUNCTION: justify all str in a list to match the length of the longest str in that list. Determined by
	len() function, i.e. number of chars, not by true width when printed, so it doesn't work well with JP/CN chars.
	
	:param j: list[str] to be justified
	:param right: by default, left-justify (right-pad). if this is true, right-justify (left-pad) instead.
	:return: list[str] after padding/justifying
	"""
	# first, look for an excuse to give up early
	if len(j) == 0 or len(j) == 1: return j
	# second, find the length of the longest string in the list
	longest_name_len = max([len(p) for p in j])
	# third, make a new list of strings that have been padded to be that length
	if right:
		# right-justify, force strings to right by padding on left
		retlist = [(" " * (longest_name_len - len(p))) + p for p in j]
	else:
		# left-justify, force strings to left by padding on right
		retlist = [p + (" " * (longest_name_len - len(p))) for p in j]
	return retlist