public int ways(int[] A, int[] B, int k)
	{
		boolean[][] nodes = new boolean[51][51];
		for (int i = 0; i < A.length; i++) {
			nodes[B[i]][A[i]] = true;
			nodes[A[i]][B[i]] = true;
		}
		if (k == 1) {
			Set<Integer> set = new HashSet<Integer>();
			for (int i = 0; i < nodes.length; i++) {
				set.add(A[i]);
				set.add(B[i]);
			}
			return set.size();
		} else if (k == 2) {
			int count = 0;
			for (int i = 0; i < nodes.length; i++) {
				for (int j = i + 1; j < nodes.length; j++) {
					count += nodes[i][j] ? 1 : 0;
				}
			}
			return count;
		} else {
			
		}
		return 0;
	}