I tried every online solution and i still get the same result..i'm trying to get my code to run on a file "distinct.txt" and here is my attempt to run it.
i tried different paths and all give same result.
here is my code
package pset2.sol;
import edu.princeton.cs.algs4.StdIn;
public class Permutation {
public static void main(String[] args){
RandomizedQueue<String> rq = new RandomizedQueue<>();
while (!StdIn.isEmpty()) {
String item = StdIn.readString();
rq.enqueue(item);
}
int k = Integer.parseInt(args[0]);
for(int i = 0; i < k; i++){
System.out.println(rq.dequeue());
}
}
}